Major Update: Link Library
[link.git] / Makefile
blobb8d698ebfed7ba1cc9dd617a588ba3f9a8809d0c
1 rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
3 CPPSourceCode = $(call rwildcard,Source,*.cpp)
4 Objects = $(patsubst Source/%.cpp, Build/%.o, $(CPPSourceCode))
5 Directories = $(wildcard Source/*)
7 default: Library Install Test
9 Build/%.o: Source/%.cpp
10 @mkdir -p $(@D)
11 @g++ -c $^ -std=c++2a -fpic -pthread -o $@
13 Library: $(Objects)
14 @g++ -shared -std=c++2a -pthread -o liblink.so $(Objects)
16 Install:
17 @cp liblink.so /usr/lib/
18 @cp -R Includes/* /usr/include/
20 .PHONY: Test
22 Test: Install
23 @make -C Test run --no-print-directory