summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7146dcb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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