version bump to 1.2.1
[rofl0r-jobflow.git] / Makefile
blob55085c4b3e209467d656f87331bc453435ce1b22
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 check: test.sh tests/stdin_printer.out
45 ./test.sh
47 .PHONY: all optimized optimized-aggressive debug odebug