diff options
author | San Jacobs | 2022-02-26 16:22:34 +0100 |
---|---|---|
committer | San Jacobs | 2022-02-26 16:22:34 +0100 |
commit | e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8 (patch) | |
tree | 2fbca372f233864d5acc1ca7b122250113f41439 | |
parent | 9c95b5e46febce9a23639ac87963489f238258dd (diff) | |
download | satscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.tar.gz satscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.tar.bz2 satscalc-e4bcf31ffe1cfcb48b161adb08dd30b77f38d1d8.zip |
Set up basic C++ project
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | makefile | 27 | ||||
-rw-r--r-- | src/main.cpp | 10 |
3 files changed, 39 insertions, 0 deletions
@@ -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; +} + |