summaryrefslogtreecommitdiffstats
path: root/03_exercise/srv/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '03_exercise/srv/Makefile')
-rw-r--r--03_exercise/srv/Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/03_exercise/srv/Makefile b/03_exercise/srv/Makefile
new file mode 100644
index 0000000..4fede74
--- /dev/null
+++ b/03_exercise/srv/Makefile
@@ -0,0 +1,23 @@
+#!/usr/bin/make
+.SUFFIXES:
+.PHONY: all run clean
+TAR = server
+SRC = $(wildcard *.c)
+OBJ = $(SRC:%.c=%.o)
+
+DEP = $(OBJ:%.o=%.d)
+-include $(DEP)
+
+%.o: %.c
+ $(CC) $(CFLAGS) $< -o $@
+
+$(TAR): $(OBJ)
+ $(CC) $(LFLAGS) $^ -o $@
+
+all: $(TAR)
+
+run: all
+ ./$(TAR)
+
+clean:
+ $(RM) $(RMFILES) $(OBJ) $(TAR) $(DEP)