aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorSanJacobs2022-08-28 13:15:23 +0200
committerSanJacobs2022-08-28 13:15:23 +0200
commit1775a5452f397b7d61e116ed21b14b5ca2dae167 (patch)
treebe9c71d1b398519443f263063a45e96b15538188 /makefile
parent881ed621f9eca0ef8303cb3818eee1fd954141c1 (diff)
downloadsatscalc-0.2.0-alpha.tar.gz
satscalc-0.2.0-alpha.tar.bz2
satscalc-0.2.0-alpha.zip
Added comfy release buildingv0.2.0-alpha
Diffstat (limited to 'makefile')
-rw-r--r--makefile33
1 files changed, 24 insertions, 9 deletions
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 <algorithm> 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