diff options
author | norly <ny-git@enpas.org> | 2013-06-19 20:20:10 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2013-06-20 22:10:23 +0100 |
commit | 7f1a29e9e33059dfebdc24bb3ffaa3dac46b58f1 (patch) | |
tree | 89f3108016eb3440ec35a9b20957f46ef999cc5c /tests/Makefile | |
parent | c98d704a812502c34d82e34949f37c8b87ae6018 (diff) |
Automate tests
Diffstat (limited to 'tests/Makefile')
-rw-r--r-- | tests/Makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..757ea21 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,37 @@ +BUILDDIR = build +SRCDIR = src + +SOURCES = $(shell find $(SRCDIR)/ -iname "*.c") +OBJS = $(patsubst $(SRCDIR)/%.c, $(BUILDDIR)/%.o, $(SOURCES)) +EXENAMES = putsmain putsmainsub +EXES = $(patsubst %, $(BUILDDIR)/%, $(EXENAMES)) + +CFLAGS = -Wall -pedantic + + + +.PHONY: testbase +testbase: $(OBJS) $(EXES) + + +.PHONY: check +check: testbase + ./runtests.sh + + +$(BUILDDIR)/putsmain: $(SRCDIR)/putsmain.c + @if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi + gcc $(CFLAGS) -o $@ $^ + +$(BUILDDIR)/putsmainsub: $(SRCDIR)/putsmainsub.c + @if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi + gcc $(CFLAGS) -o $@ $^ + +$(BUILDDIR)/%.o: $(SRCDIR)/%.c + @if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi + gcc $(CFLAGS) -c -o $@ $< + + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/ |