diff options
Diffstat (limited to 'src/01/02b/Makefile')
| -rw-r--r-- | src/01/02b/Makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/01/02b/Makefile b/src/01/02b/Makefile new file mode 100644 index 0000000..fd91d8e --- /dev/null +++ b/src/01/02b/Makefile @@ -0,0 +1,37 @@ +#!/usr/bin/make -f +SHELL=/bin/sh + +CC=clang +TEST_LIBS = -lcgreen + +BUILDDIR := build +OBJS := $(addprefix $(BUILDDIR)/,doubly_linked_list.o) +TEST_OBJS := $(addprefix $(BUILDDIR)/,doubly_linked_list_test.o) + +$(BUILDDIR)/%.o : %.c + $(COMPILE.c) $(OUTPUT_OPTION) $< + +.PHONY: all +all: $(OBJS) $(BUILDDIR)/main.o + $(CC) $(OBJS) $(BUILDDIR)/main.o -o $(BUILDDIR)/program + +.PHONY: test +test: $(OBJS) $(TEST_OBJS) + $(CC) $(OBJS) $(TEST_OBJS) $(TEST_LIBS) -o $(BUILDDIR)/test + +$(OBJS): | $(BUILDDIR) + +$(TEST_OBJS): | $(BUILDDIR) + +$(BUILDDIR): + mkdir $(BUILDDIR) + +.PHONY: clean +clean: + rm -fr build + +run : all + ./build/program + +run_test : test + cgreen-runner -c -v $(BUILDDIR)/test |
