-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
38 lines (26 loc) · 898 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#$(dir pwd) is equal to "./"
#$(CURDIR) is equal to "/home/armen/Documents/CONTAINER_CLASSES"
SOURCES = $(wildcard Sources/*.cpp)
OBJECTS = $(patsubst Sources/%.cpp,Objects/%.o, $(SOURCES))
HEADERS = $(patsubst Sources/%.cpp,Headers/%.hpp, $(SOURCES))
DEPS = $(patsubst Sources/%.cpp,Deps/%.dep, $(SOURCES))
TARGET = Bin/sle_solution.exe
.PHONY : clean
$(TARGET) : $(OBJECTS)
@mkdir -pv Bin
@echo "Linking.."
gcc $^ -lstdc++ -ldinsle -ldinsle_gsj -L./Libs -o $@
Objects/%.o : Sources/%.cpp
@mkdir -pv Objects
@echo "Building object files: $@"
gcc -c $< -I Headers -o $@
Deps/%.dep : Sources/%.cpp
@mkdir -pv Deps
@echo "building $@ file.."
gcc -MM $< -MT "$@ $(addprefix Objects,$(basename $(notdir $@)).o)" -I Headers -o $@
clean :
@echo "Cleaning: All generated objects are deleted.."
rm -rf Bin Objects Deps
ifneq ($(MAKECMDGOALS), clean)
-include $(DEPS)
endif