-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
53 lines (46 loc) · 1.01 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
53
MK_SETTINGS_DIR := make_settings
DEPENDENCIES := Makefile
include $(MK_SETTINGS_DIR)/src_files.mk
include $(MK_SETTINGS_DIR)/settings.mk
include $(MK_SETTINGS_DIR)/output.mk
all:
$(MAKE) -C Website
$(MAKE) $(NAME) -j4
# Compilation
$(NAME): $(OBJ)
$(CXX) -o $@ $(OBJ) $(LFLAGS)
$(OBJ): $(ODIR)/%.o: $(SDIR)/%.cpp $(DEPENDENCIES)
@mkdir -p $(@D)
$(CXX) -c -o $@ $< $(CXXFLAGS) $(IFLAGS)
$(DDIR)/%.d: $(SDIR)/%.cpp
@mkdir -p $(@D)
$(CXX) $< -MM -MF $@ -MT $(ODIR)/$*.o $(IFLAGS) $(CXXFLAGS)
# Clean up
.PHONY: clean fclean re
clean:
$(RM) -r $(DDIR)
$(RM) -r $(ODIR)
fclean: clean
$(RM) $(EXECS)
re: fclean
$(MAKE) all
# Catch
.PHONY: catch debug fsanitize
catch:
$(MAKE) all USING_CATCH=1
debug:
$(MAKE) all DEBUG=1
fsanitize:
$(MAKE) all FSANITIZE=1
# Printing
.phony: verbose printall noinfo
verbose:
$(RM) $(ODIR)/$(OUTPUT_FILE)
$(MAKE) all PRINT_VERBOSE=1
printall:
$(RM) $(ODIR)/$(OUTPUT_FILE)
$(MAKE) all PRINT_VERBOSE=1 PRINT_DEBUG=1
default:
$(RM) $(ODIR)/$(OUTPUT_FILE)
$(MAKE) all
-include $(DEP)