aboutsummaryrefslogtreecommitdiff
path: root/week-5/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-09-28 13:16:16 +0200
committerlonkaars <loek@pipeframe.xyz>2022-09-28 13:22:10 +0200
commit5c8d2ae4da91571f92f26d6e8352538c043e6b56 (patch)
treec285e6428af294551d33510c699addcedffe766a /week-5/makefile
parent841697f039dc5670f53ec6597ef6f639eeebcb5a (diff)
week 5 huiswerk toegevoegd
Diffstat (limited to 'week-5/makefile')
-rw-r--r--week-5/makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/week-5/makefile b/week-5/makefile
new file mode 100644
index 0000000..3b71b5b
--- /dev/null
+++ b/week-5/makefile
@@ -0,0 +1,24 @@
+CC = gcc
+LD = gcc
+RM = rm -f
+TARGET = main
+
+LFLAGS += -lstdc++
+
+SRCS := $(wildcard *.cpp)
+OBJS := $(patsubst %.cpp,%.o, $(SRCS))
+
+all: main
+
+%.o: %.cpp
+ $(CC) -c $(CFLAGS) $< -o $@
+
+$(TARGET): $(OBJS)
+ $(LD) $^ $(LFLAGS) -o $@
+
+clean:
+ $(RM) $(TARGET) $(OBJS)
+
+compile_commands: clean
+ compiledb make
+