-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
93 lines (72 loc) · 2.69 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Mee's C/C++ Makefile Supreme
#
# -----------------------------------------------------------------------------
include version
include .config/constants
-include $(BUILDCONFIGURATION)
include .config/functions
# -----------------------------------------------------------------------------
# special make variables
.DEFAULT_GOAL := default
.EXTRA_PREREQS := makefile
# -----------------------------------------------------------------------------
# SPECIAL TARGETS
.PHONY: all
all: $(BINDIR)/$(TARGET) doc
.PHONY: default
default: $(BINDIR)/$(TARGET)
# -----------------------------------------------------------------------------
# CONFIG TARGET
.PHONY: config
.NOTPARALLEL: config
config:
@.config/select_config.sh
# VERSION TARGET
.PHONY: printversion
printversion:
@echo $(VERSION_TRIM)
# -----------------------------------------------------------------------------
# LINKING TARGET
$(BINDIR)/$(TARGET): $(LINKINGOBJECTS) $(BUILDCONFIGURATION)
@dirname $@ | xargs mkdir -p
$(LD) $(LDFLAGS) $(LINKINGOBJECTS) -o $@
# COMPILING TARGET
$(OUTDIR)/$(BLDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(CPPEXT) $(BUILDCONFIGURATION)
@dirname $@ | xargs mkdir -p
$(CPP) $(CPPFLAGS) $(VPRE_FLAGS) $(COMPILERINCLUDES) -c $< -o $@
# IMGUI COMPILING TARGETS
$(OUTDIR)/$(LIBIMGUI)/%.$(OBJEXT): $(LIBDIR)/$(LIBIMGUI)/%.$(CPPEXT) $(BUILDCONFIGURATION)
@dirname $@ | xargs mkdir -p
$(CPP) $(IMGUIFLAGS) -iquote $(LIBDIR)/$(LIBIMGUI) -c $< -o $@
# TEXTEDIT COMPILING TARGETS
$(OUTDIR)/$(LIBTEXTEDIT)/%.$(OBJEXT): $(LIBDIR)/$(LIBTEXTEDIT)/%.$(CPPEXT) $(BUILDCONFIGURATION)
@dirname $@ | xargs mkdir -p
$(CPP) $(IMGUIFLAGS) -iquote $(LIBDIR)/$(LIBIMGUI) -c $< -o $@
# TINYXML COMPILING TARGETS
$(OUTDIR)/$(LIBTINYXML)/%.$(OBJEXT): $(LIBDIR)/$(LIBTINYXML)/%.$(CPPEXT) $(BUILDCONFIGURATION)
@dirname $@ | xargs mkdir -p
$(CPP) $(IMGUIFLAGS) -c $< -o $@
# -----------------------------------------------------------------------------
# DOCUMENTATION TARGET
.PHONY: doc
doc: $(DOCDIR)/$(DOXYFILE)
VERSION_TRIM="$(VERSION_TRIM)" doxygen $(DOCDIR)/$(DOXYFILE)
# -----------------------------------------------------------------------------
# CLEANUP TARGET
.PHONY: clean
.NOTPARALLEL: clean
clean:
rm -rf $(OUTDIR) $(BINDIR) $(DOCDIR)/doxygen.log
# RESET TARGET
.PHONY: reset
.NOTPARALLEL: reset
reset: clean
rm -rf $(BUILDCONFIGURATION) $(DOCDIR)/html $(DOCDIR)/latex $(DOCDIR)/man
# -----------------------------------------------------------------------------
# HEADER DEPENDENCY INCLUDES
-include $(OUTDIR)/$(BLDDIR)/$(MAINFILE:%.$(CPPEXT)=%.$(MAKEXT))
-include $(OBJECTS:%.$(OBJEXT)=%.$(MAKEXT))
-include $(IMGUIOBJECTS:%.$(OBJEXT)=%.$(MAKEXT))
-include $(TEXTEDITOBJECTS:%.$(OBJEXT)=%.$(MAKEXT))
-include $(TINYXMLOBJECTS:%.$(OBJEXT)=%.$(MAKEXT))