4 exename_testbin
= run_tests
17 # sources for the tinyjs frontend
21 # sources for the unittest program
25 # names for intermediate files
26 objects
= $(sources
:.
cpp=.o
)
27 objects_main
= $(sources_main
:.
cpp=.o
)
28 objects_testbin
= $(sources_testbin
:.
cpp=.o
)
30 #############################################
31 ### warning: edit below at your own risk! ###
32 #############################################
34 # construct the physical library file from the library name
35 libfile
= lib
$(libname
).a
37 # need C++11 support (not going to change, sorry folks)
38 CXX
= clang
++ -std
=c
++11
40 # flags for header file paths
43 # remove underscore for heavy-duty checks.
46 -pedantic
-Wall
-Wextra \
50 -Wdisabled-optimization \
53 -Wmissing-declarations \
55 -Woverloaded-virtual \
66 CFLAGS
= $(INCFLAGS
) $(WFLAGS
) -c
-g
-rdynamic
-D_DEBUG
69 LDFLAGS
= -g
-rdynamic
-L.
-Wl
,-rpath
=.
70 BINFLAGS
= -l
$(libname
) $(LDFLAGS
)
72 ##########################
73 #### tasks begin here ####
74 ##########################
77 all: $(objects
) $(libfile
) $(exename_testbin
) $(exename_main
)
79 # task for building the libfile (static or dynamic -- modify accordingly!)
80 $(libfile
): $(objects
)
81 ar rcs
$(libfile
) $(objects
)
83 # task for building our frontend executable
84 $(exename_main
): $(libfile
) $(objects_main
)
85 $(CXX
) -o
$(exename_main
) $(objects_main
) $(BINFLAGS
)
87 # task for building our unittesting application
88 $(exename_testbin
): $(libfile
) $(objects_testbin
)
89 $(CXX
) -o
$(exename_testbin
) $(objects_testbin
) $(BINFLAGS
)
91 # task for cleaning up intermediate files
95 rm -f
$(objects_testbin
)
97 # task for cleaning up everything else as well, leaving
98 # us with the sources only (hence **dist**clean)
101 rm -f
$(exename_main
)
102 rm -f
$(exename_testbin
)
104 # invoke distclean, and rebuild every binary
105 rebuild
: distclean all
107 # the 'sed' part here is to strip color codes from the diagnostic
108 # output -- specifically from clang. only reason being that NppExec
109 # (yes, the Notepad++ plugin) can't handle it. sorry :-)
111 $(CXX
) $(CFLAGS
) $< -o
$@
2>&1 | sed
's/\o33\[30m/\o33[37m/g'