aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorSan Jacobs2022-02-26 16:22:34 +0100
committerSan Jacobs2022-02-26 16:22:34 +0100
commite4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8 (patch)
tree2fbca372f233864d5acc1ca7b122250113f41439 /makefile
parent9c95b5e46febce9a23639ac87963489f238258dd (diff)
downloadsatscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.tar.gz
satscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.tar.bz2
satscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.zip
Set up basic C++ project
Diffstat (limited to 'makefile')
-rw-r--r--makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..ef4d837
--- /dev/null
+++ b/makefile
@@ -0,0 +1,27 @@
+# INCLUDE is where you find the headerfiles for the libs you're using. They are used during compilation.
+INCLUDE=-I /usr/include/boost/
+
+# 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/
+
+# LIBS are the libs you are using written with a -l and then ignoring the lib-part at the beginning of the file's name.
+# So "libboost_date_time.a" will be just "-lboost_date_time"
+LIBS=-lboost_date_time
+
+# Sources are the source code files. Only the .cpp files, becuase the .h files are included into them during pre-processing.
+SOURCES=$(wildcard src/*.cpp)
+OBJDIR=obj/
+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) $(LIBS) $(OBJECTS)
+
+$(OBJECTS): obj/%.o : src/%.cpp
+ g++ $(INCLUDE) -c $< -o $@
+
+clean:
+ rm obj/*.o
+
+cleanall:
+ rm obj/*.o a.out