summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7146dcb688919ec575fe10079c5d7dd37d318af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
CFLAGS += -g -Wall
LDFLAGS += -lm

all: tsn_listener

ALL_SOURCES:=$(wildcard *.c)

tsn_listener: %: $(ALL_SOURCES:.c=.o)
	@echo "CC " $@
	@$(CC) -o $@ $^ $(LDFLAGS)

# Option -MD needed to generate .d files in order to include them
%.o: %.c
	@echo "CC " $@
	@$(CC) -c -MD $< -o $@ $(CFLAGS)

#include targets for all headers, generated by -MD command
include $(wildcard *.d)

clean:
	rm -f *.o *.d tsn_listener

distclean: clean
	rm -rf cscope* tags

.PHONY: clean distclean