-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (35 loc) · 1.26 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Include = -I Include
COMP_FLAGS = -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wunreachable-code -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -Weffc++ -Wmain -Wextra -Wall -g -pipe -fexceptions -Wcast-qual -Wconversion -Wctor-dtor-privacy -Wempty-body -Wformat-security -Wformat=2 -Wignored-qualifiers -Wlogical-op -Wno-missing-field-initializers -Wnon-virtual-dtor -Woverloaded-virtual -Wpointer-arith -Wsign-promo -Wstack-usage=8192 -Wstrict-aliasing -Wstrict-null-sentinel -Wtype-limits -Wwrite-strings -Werror=vla -D_DEBUG -D_EJUDGE_CLIENT_SIDE
COMP_FLAGS += $(Include)
CC = g++
Sources = $(wildcard $(Source)/*.cpp)
Objects = $(patsubst $(Source)/%.cpp,$(Build)/%.o,$(Sources))
Cpp = $(wildcard *.cpp)
H = $(wildcard *.h)
Build = Build
Source = Source
Exe = HellStack.exe
all: $(Build)/$(Exe)
$(Build)/%.o : $(Source)/%.cpp | $(Build)
$(CC) $(COMP_FLAGS) $< -c -o $@
$(Build)/$(Exe): $(Objects) | $(Build)
$(CC) $(COMP_FLAGS) -o $(Build)/$(Exe) $(Objects)
$(Build):
mkdir -p $(Build)
cleanup:
ifdef Cpp
mkdir -p Source
mv *.cpp Source
endif
ifdef H
mkdir -p Include
mv *.h Include
endif
rm -rf *.o
run:
$(Build)/$(Exe)
clean:
rm -rf ./$(Build)
test:
echo $(Sources)
echo $(Objects)