🐛 fix compilation error of modules on macOS platform

This commit is contained in:
ValKmjolnir 2022-08-10 19:48:01 +08:00
parent d65868f1e9
commit 2f43c47e77
2 changed files with 15 additions and 10 deletions

View File

@ -15,15 +15,17 @@ SRC=\
nasal_dbg.h\
nasal.h
CPPSTANDARD=-std=c++11
nasal:$(SRC)
$(CXX) -std=c++11 -O3 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
$(CXX) $(CPPSTANDARD) -O3 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
nasal.exe:$(SRC)
$(CXX) -std=c++11 -O3 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
$(CXX) $(CPPSTANDARD) -O3 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
stable-release:$(SRC)
$(CXX) -std=c++11 -O2 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
$(CXX) $(CPPSTANDARD) -O2 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
stable-release-mingw:$(SRC)
$(CXX) -std=c++11 -O2 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
$(CXX) $(CPPSTANDARD) -O2 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
test:nasal
@ ./nasal -op -e test/ascii-art.nas

View File

@ -1,28 +1,31 @@
.PHONY=clean all mingw-all
CPPSTANDARD=-std=c++11
libfib.so: fib.cpp
$(CXX) -c -O3 fib.cpp -fPIC -o fib.o
$(CXX) $(CPPSTANDARD) -c -O3 fib.cpp -fPIC -o fib.o
$(CXX) -shared -o libfib.so fib.o
rm fib.o
libfib.dll: fib.cpp
$(CXX) -c -O3 fib.cpp -fPIC -o fib.o
$(CXX) $(CPPSTANDARD) -c -O3 fib.cpp -fPIC -o fib.o
$(CXX) -shared -o libfib.dll fib.o
del fib.o
libkey.so: keyboard.cpp
$(CXX) -c -O3 keyboard.cpp -fPIC -o keyboard.o
$(CXX) $(CPPSTANDARD) -c -O3 keyboard.cpp -fPIC -o keyboard.o
$(CXX) -shared -o libkey.so keyboard.o
rm keyboard.o
libkey.dll: keyboard.cpp
$(CXX) -c -O3 keyboard.cpp -fPIC -o keyboard.o -static
$(CXX) $(CPPSTANDARD) -c -O3 keyboard.cpp -fPIC -o keyboard.o -static
$(CXX) -shared -o libkey.dll keyboard.o -static
del keyboard.o
libnasock.so: nasocket.cpp
$(CXX) -c -O3 nasocket.cpp -fPIC -o nasocket.o
$(CXX) $(CPPSTANDARD) -c -O3 nasocket.cpp -fPIC -o nasocket.o
$(CXX) -shared -o libnasock.so nasocket.o
rm nasocket.o
libnasock.dll: nasocket.cpp
$(CXX) -c -O3 nasocket.cpp -fPIC -o nasocket.o -lwsock32 -static
$(CXX) $(CPPSTANDARD) -c -O3 nasocket.cpp -fPIC -o nasocket.o -lwsock32 -static
$(CXX) -shared -o libnasock.dll nasocket.o -lwsock32 -static
del nasocket.o