From 1775a5452f397b7d61e116ed21b14b5ca2dae167 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Sun, 28 Aug 2022 13:15:23 +0200 Subject: Added comfy release building --- makefile | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index c86d5af..0785786 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,13 @@ CXX = g++ # Enabling C++17 mode so I can have more stuff CVERSION=-std=c++17 -CFLAGS= +# Native compilation flags and crosscompilation flags for Windows +CFLAGS=-g +WINFLAGS=-g -gcodeview + +# Executable name stuff +V=v0.2.0-alpha +NAME=satscalc # LIBDIR is where you can find the linkable objects or whatever. They are used for the linking stage. # -L /usr/lib/x86_64-linux-gnu/ @@ -25,26 +31,35 @@ 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) - $(CXX) $(LIBDIR) $(CVERSION) $(CFLAGS) $(LIBS) $(OBJECTS) -o satscalc + $(CXX) $(LIBDIR) $(CVERSION) $(LIBS) $(OBJECTS) -o $(NAME) $(OBJECTS): obj/%.o : src/%.cpp mkdir -p $(OBJDIR) - $(CXX) -g $(INCLUDE) $(CVERSION) $(CFLAGS) -c $< -o $@ + $(CXX) $(CFLAGS) $(INCLUDE) $(CVERSION) $(CFLAGS) -c $< -o $@ windows: - zig c++ -target x86_64-windows-gnu src/*.cpp $(CVERSION) -g -gcodeview -o satscalc.exe + zig c++ -target x86_64-windows-gnu src/*.cpp $(CVERSION) $(WINFLAGS) -o $(NAME).exe windows32: - zig c++ -target i386-windows-gnu src/*.cpp $(CVERSION) -g -gcodeview -o satscalc32.exe + zig c++ -target i386-windows-gnu src/*.cpp $(CVERSION) $(WINFLAGS) -o $(NAME).exe mac: - zig c++ -target x86_64-macos-gnu src/*.cpp $(CVERSION) -g -gcodeview -o satscalc - + zig c++ -target x86_64-macos-gnu src/*.cpp $(CVERSION) $(CFLAGS) -o $(NAME) + +release: + mkdir -p bin/linux + make CFLAGS=-O2 NAME=bin/linux/$(NAME)-$(V) + mkdir -p bin/mac + make mac CFLAGS=-O2 NAME=bin/mac/$(NAME)-$(V) + mkdir -p bin/windows + make windows WINFLAGS="-O2 --static" NAME=bin/windows/$(NAME)-$(V) + make windows32 WINFLAGS="-O2 --static" NAME=bin/windows/$(NAME)-$(V)-win32 + clean: - rm obj/*.o + rm -f obj/*.o cleanall: - rm obj/*.o a.out + rm -rf obj/*.o bin/ $(NAME) install: a.out cp satscalc /usr/local/bin/satscalc -- cgit v1.2.1