1 ##################################################
2 #Desc: Mihrtec Standard Makefile
5 ##################################################
6 #Application Information
7 ##################################################
8 #Executable name, also passed as -DAPPNAME to compiler
10 #Directory in which we expect to find main()
12 #Compiler flags for the final executable
14 #Object files statically linked for the executable
16 #Dependencies which must be built before the executable
18 ##################################################
20 ##################################################
21 #Functions to export for JS Module
22 EXPORT_FUNCS
:= em_main auth_encrypt
23 #Flags to always run on emcc/em++
26 #Import the build system setup
27 include .make
/build.mk
29 #Targets that don't generate a file
30 .PHONY
: $(APPNAME
) run push dox doc
clean scrub
all default
31 #Define default rules to point to APPNAME
32 all default
: $(APPTARG
)
35 $(APPNAME
) $(APPTARG
): $(APPDEPS
) |
$(APPDIRS
)
36 $(CC
) -o
$(APPTARG
) $(APPFLAGS
) $(APPDEPS
)
42 #run the game after making it
46 #push to github after successful compile
48 @printf
'\nEnter a commit message:\n'; \
50 git commit
-am
"$$CMT"
56 #clean up intermediate dependency files and binaries
58 @echo
"Cleaning build targets"
59 rm -f
$(APPTARG
) $(WEBTARG
) $(CTARG
)
61 #Scrub down to minimal distribution
64 ################## DEFAULTS #####################
65 #cancel default %.o behavior for %.d dependency
68 #Generate and evaluate C dependencies
69 $(foreach base
,$(basename $(sort $(strip $(CTARG
)))),\
70 $(eval
$(strip $(base
)$(COBJSUF
): $(shell $(subst $BASE,$(base
),$(CGENDEP
))))))
72 #new default C build rule
73 %.bc
%.o
: %.c
$(CDEPS
)
74 $(CC
) $(CXXFLAGS
) $(CFLAGS
) $< -c
-o
$@
76 #construct list of cp rules for each web item
78 $(WEBTARG
): $(HTMLDIR
)/$(filter-out $(EXEDIR
),$@
)
82 #force including rules for making each lib in this case
84 include $(foreach lib
,$(MISSINGLIBS
),.make
/lib
$(lib
).mk
)