allow -j as an alias for -threads
[rofl0r-jobflow.git] / Makefile
blobae9322d892ef470aa9fe5c2caea390a92d5c4736
1 LINKLIBS=""
3 FNAME=jobflow
5 MAINFILE=$(FNAME).c
6 OUTFILE=$(FNAME).out
8 CFLAGS_OWN=-Wall -Wextra -std=c99 -D_GNU_SOURCE
9 CFLAGS_DBG=-g -O0
10 CFLAGS_OPT=-Os -s
11 CFLAGS_OPT_AGGRESSIVE=-O3 -s -flto -fwhole-program
13 TESTSRC=$(sort $(wildcard tests/*.c))
14 TESTS=$(TESTSRC:.c=.out)
16 -include config.mak
18 CFLAGS_RCB_OPT_AGGRESSIVE=$(DB_FLAGS) ${CFLAGS_OWN} ${CFLAGS_OPT_AGGRESSIVE} ${CFLAGS}
19 CFLAGS_RCB_OPT=$(DB_FLAGS) ${CFLAGS_OWN} ${CFLAGS_OPT} ${CFLAGS}
20 CFLAGS_RCB_DBG=$(DB_FLAGS) ${CFLAGS_OWN} ${CFLAGS_DBG} ${CFLAGS}
22 all: debug
24 optimized:
25 CFLAGS="${CFLAGS_RCB_OPT} -s" rcb --force $(RCBFLAGS) ${MAINFILE} $(LINKLIBS)
26 strip --remove-section .comment ${OUTFILE}
28 optimized-aggressive:
29 CFLAGS="${CFLAGS_RCB_OPT_AGGRESSIVE} -s" rcb --force $(RCBFLAGS) ${MAINFILE} $(LINKLIBS)
30 strip --remove-section .comment ${OUTFILE}
32 odebug:
33 CFLAGS="${CFLAGS_RCB_OPT} -g" rcb --force $(RCBFLAGS) ${MAINFILE} $(LINKLIBS)
34 debug-stripper.sh $(OUTFILE)
36 debug:
37 CFLAGS="${CFLAGS_RCB_DBG}" rcb --force $(RCBFLAGS) ${MAINFILE} $(LINKLIBS)
39 tests: $(TESTS)
41 tests/%.out: tests/%.c
42 CFLAGS="${CFLAGS_RCB_DBG}" rcb --force $(RCBFLAGS) $<
44 .PHONY: all optimized optimized-aggressive debug odebug