diff options
| -rw-r--r-- | src/01/01a/Makefile | 22 | ||||
| -rw-r--r-- | src/01/01a/main.c | 8 | ||||
| -rw-r--r-- | src/01/01a/priority_queue.c | 1 |
3 files changed, 24 insertions, 7 deletions
diff --git a/src/01/01a/Makefile b/src/01/01a/Makefile index 7952e21..43a68da 100644 --- a/src/01/01a/Makefile +++ b/src/01/01a/Makefile @@ -2,20 +2,27 @@ SHELL=/bin/sh CC=gcc -LIBS = -lcgreen +TEST_LIBS = -lcgreen BUILDDIR := build -OBJS := $(addprefix $(BUILDDIR)/,priority_queue.o priority_queue_test.o) +OBJS := $(addprefix $(BUILDDIR)/,priority_queue.o) +TEST_OBJS := $(addprefix $(BUILDDIR)/,priority_queue_test.o) $(BUILDDIR)/%.o : %.c $(COMPILE.c) $(OUTPUT_OPTION) $< .PHONY: all -all: $(OBJS) - $(CC) $(OBJS) $(LIBS) -o $(BUILDDIR)/program +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) @@ -23,5 +30,8 @@ $(BUILDDIR): clean: rm -fr build -test : all - cgreen-runner -c -v $(BUILDDIR)/program +run : all + ./build/program + +run_test : test + cgreen-runner -c -v $(BUILDDIR)/test diff --git a/src/01/01a/main.c b/src/01/01a/main.c new file mode 100644 index 0000000..9f50782 --- /dev/null +++ b/src/01/01a/main.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include "priority_queue.h" + +int main(int argc, char *argv[]) +{ + printf("hello world\n"); + return 0; +} diff --git a/src/01/01a/priority_queue.c b/src/01/01a/priority_queue.c index f6e3364..2d0670d 100644 --- a/src/01/01a/priority_queue.c +++ b/src/01/01a/priority_queue.c @@ -65,4 +65,3 @@ void destroy(PriorityQueue *queue) { } free(queue); } - |
