X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Makefile;h=ee57e1d44210b202957748fa50974446347db716;hb=c8c3b3d8b2755bddb5c9562ead12d659c31f3090;hp=d3185636f5a9d2aa285760d135cd9c87520f4dc7;hpb=71843db5886f60d3959d966a5e062a516c24798e;p=smdp.git diff --git a/Makefile b/Makefile index d318563..ee57e1d 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,23 @@ -# set some compiler flags -CFLAGS=-lncurses - -# find *.c in the current directory -SOURCES=$(wildcard *.c) -TESTS=$(wildcard test/*.c) - -# define the output objects by replacing .c with .o -TARGETS=$(SOURCES:.c=) -TEST_TARGETS=$(TESTS:.c=) - -# this will make all objects -all: $(TEST_TARGETS) $(TARGETS) -test: $(TEST_TARGETS) - -# each objects will be build by a *.c file -#%.o: %.c -%: %.c - cc $(CFLAGS) -o $@ $^ - -# this will delete all objects -# if not all objects are there, they will be compiled first -clean: $(TARGETS) $(TEST_TARGETS) - rm -f $^ +tmp: tmp.c cstring.o markdown.o markdown_io.o + cc -g -o tmp tmp.c cstring.o markdown.o markdown_io.o + +markdown_io.o: markdown_io.c cstring.o markdown.o + cc -g -c markdown_io.c -o markdown_io.o -lmarkdown + +markdown.o: markdown.c cstring.o + cc -g -c markdown.c -o markdown.o -lcstring + +cstring.o: cstring.c + cc -g -c cstring.c -o cstring.o + +all: tmp + +.PHONY: test + +test: + $(MAKE) -C test + +clean: + rm -f tmp *.o + $(MAKE) -C test clean