diff options
author | San Jacobs | 2022-08-05 12:06:04 +0200 |
---|---|---|
committer | San Jacobs | 2022-08-05 12:06:04 +0200 |
commit | fc220c029bf2aaea554ce1909e08f25d8947b4cf (patch) | |
tree | 9ae054882c04d54e5025802ed502dfae4c3db436 | |
parent | 8b0058d1de2865f47d627215d315bd639ed37fb7 (diff) | |
download | satscalc-fc220c029bf2aaea554ce1909e08f25d8947b4cf.tar.gz satscalc-fc220c029bf2aaea554ce1909e08f25d8947b4cf.tar.bz2 satscalc-fc220c029bf2aaea554ce1909e08f25d8947b4cf.zip |
Windows cross-compilation!
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | makefile | 12 | ||||
-rwxr-xr-x | windows_crosscompile.sh | 2 |
3 files changed, 12 insertions, 3 deletions
@@ -1,4 +1,5 @@ __pycache__ obj/*.o a.out +a.exe notes.txt @@ -2,8 +2,13 @@ # Example: -I /usr/include/boost/ INCLUDE= +# Compiler. Pretty self-explanatory. +CXX = g++ + # Enabling C++17 mode so I can have more <algorithm> stuff -CFLAGS=-std=c++17 +CVERSION=-std=c++17 + +CFLAGS= # LIBDIR is where you can find the linkable objects or whatever. They are used for the linking stage. LIBDIR=-L /usr/lib/x86_64-linux-gnu/ @@ -19,11 +24,11 @@ OBJECTS=$(patsubst src/%.cpp, $(OBJDIR)%.o, $(SOURCES)) # This last line creates an identical list of objects based on the list of .cpp files. a.out: $(OBJECTS) - g++ $(LIBDIR) $(CFLAGS) $(LIBS) $(OBJECTS) + $(CXX) $(LIBDIR) $(CVERSION) $(CFLAGS) $(LIBS) $(OBJECTS) $(OBJECTS): obj/%.o : src/%.cpp mkdir -p obj - g++ -g $(INCLUDE) $(CFLAGS) -c $< -o $@ + $(CXX) -g $(INCLUDE) $(CVERSION) $(CFLAGS) -c $< -o $@ clean: rm obj/*.o @@ -33,3 +38,4 @@ cleanall: install: a.out cp a.out /usr/bin/satscalc + diff --git a/windows_crosscompile.sh b/windows_crosscompile.sh new file mode 100755 index 0000000..ae3dcbd --- /dev/null +++ b/windows_crosscompile.sh @@ -0,0 +1,2 @@ +make clean +make CXX=x86_64-w64-mingw32-g++ CFLAGS=-static |