aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--makefile27
-rw-r--r--src/main.cpp10
3 files changed, 39 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index bee8a64..2e72315 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
__pycache__
+obj/*
+a.out
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
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..ea3604c
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,10 @@
+#include <iostream>
+#include <boost/date_time/time_duration.hpp>
+
+int main()
+{
+ tm test_moment_one{0, 30, 14, 27, 11, 2010};
+ std::cout << "Testing 123" << std::endl;
+ return 0;
+}
+