aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-10 22:13:51 +0200
committerMattias Andrée <maandree@kth.se>2016-07-10 22:13:51 +0200
commita29c4b88bcaedca06f4543e01d6e60fec8164a2a (patch)
tree0cddb36450c71d086ea5336cf56dd84b1f5f4952
parentm (diff)
downloadcoopgammad-a29c4b88bcaedca06f4543e01d6e60fec8164a2a.tar.gz
coopgammad-a29c4b88bcaedca06f4543e01d6e60fec8164a2a.tar.bz2
coopgammad-a29c4b88bcaedca06f4543e01d6e60fec8164a2a.tar.xz
Add makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ccaa8e1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+SRC = filter gammad output ramps
+
+OPTIMISE = -Og -g
+
+WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
+ -Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
+ -Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wsync-nand \
+ -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow -Wdeclaration-after-statement \
+ -Wundef -Wbad-function-cast -Wcast-qual -Wwrite-strings -Wlogical-op -Waggregate-return \
+ -Wstrict-prototypes -Wold-style-definition -Wpacked -Wvector-operation-performance \
+ -Wunsuffixed-float-constants -Wsuggest-attribute=const -Wsuggest-attribute=noreturn \
+ -Wsuggest-attribute=pure -Wsuggest-attribute=format -Wnormalized=nfkc -Wconversion
+
+FFLAGS = -fstrict-aliasing -fstrict-overflow -fipa-pure-const -ftree-vrp -fstack-usage \
+ -funsafe-loop-optimizations
+
+CCFLAGS = -std=c99 $(WARN) $(FFLAGS) $(OPTIMISE)
+LDFLAGS = $(OPTIMISE) -lgamma
+CPPFLAGS =
+
+
+.PHONY: all
+all: bin/gammad
+
+bin/gammad: $(foreach S,$(SRC),obj/$(S).o)
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) $(LDFLAGS) -o $@ $^
+
+obj/%.o: src/%.c src/*.h
+ @mkdir -p -- "$$(dirname -- "$@")"
+ $(CC) $(CCFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+
+.PHONY: clean
+clean:
+ -rm -r bin obj
+