64 lines
1 KiB
Makefile
64 lines
1 KiB
Makefile
|
|
# vim: noexpandtab tabstop=4 :
|
|
|
|
buildtype ?= release
|
|
|
|
optionset = buildtypes/${buildtype}.txt
|
|
|
|
prefix = bin/${buildtype}
|
|
|
|
default: ${prefix}/bsimp
|
|
|
|
.PRECIOUS: %/
|
|
|
|
%/:
|
|
@mkdir -p $@
|
|
|
|
srcs += calculate_simplifications.c calculate_assignment_simplifications.c
|
|
srcs += cmdln.c evaluate.c debug.c
|
|
srcs += get_cached_simplifications.c main.c print.c
|
|
|
|
${prefix}/%.o ${prefix}/%.d: %.c ${optionset} | ${prefix}/%/
|
|
@echo "compiling (${buildtype}) ${*}.c ..."
|
|
@gcc -c @${optionset} $< -MD -MF ${prefix}/${*}.d -o ${prefix}/${*}.o
|
|
|
|
objs = $(patsubst %.c,${prefix}/%.o,${srcs})
|
|
|
|
${prefix}/bsimp: ${optionset} ${objs} | bin/
|
|
@echo "linking (${buildtype})"
|
|
@gcc @${optionset} ${objs} -o $@
|
|
|
|
args =
|
|
|
|
run: ${prefix}/bsimp
|
|
$< $(args)
|
|
|
|
valrun: ${prefix}/bsimp
|
|
valgrind --max-stackframe=2031768 \
|
|
--exit-on-first-error=yes --error-exitcode=1 -- $< ${args}
|
|
|
|
PREFIX ?= ${HOME}
|
|
|
|
install: ${PREFIX}/bin/bsimp
|
|
|
|
${PREFIX}/bin/bsimp: bin/release/bsimp | ${PREFIX}/bin/
|
|
cp -vau $< $@
|
|
|
|
include $(patsubst %.c,${prefix}/%.d,${srcs})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|