cstring header + test
[smdp.git] / Makefile
1 # set some compiler flags
2 CFLAGS=-lncurses
3
4 # find *.c in the current directory
5 SOURCES=$(wildcard *.c)
6 TESTS=$(wildcard test/*.c)
7
8 # define the output objects by replacing .c with .o
9 TARGETS=$(SOURCES:.c=)
10 TEST_TARGETS=$(TESTS:.c=)
11
12 # this will make all objects
13 all: $(TEST_TARGETS) $(TARGETS) 
14 test: $(TEST_TARGETS)
15
16 # each objects will be build by a *.c file
17 #%.o: %.c
18 %: %.c
19         cc $(CFLAGS) -o $@ $^
20
21 # this will delete all objects
22 # if not all objects are there, they will be compiled first
23 clean: $(TARGETS) $(TEST_TARGETS)
24         rm -f $^
25