aboutsummaryrefslogtreecommitdiff
path: root/week-3/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-09-12 10:20:36 +0200
committerlonkaars <loek@pipeframe.xyz>2022-09-12 10:20:36 +0200
commitafe7337bd1230dfbed207ead0655f3b8a2362180 (patch)
treeefd1f6740a7d6ddf2b2bfeb0565244ce113b2f17 /week-3/makefile
parente15333e1987bda84fd787eec8e78ea98f95a77a7 (diff)
week 3 huiswerk toegevoegd
Diffstat (limited to 'week-3/makefile')
-rw-r--r--week-3/makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/week-3/makefile b/week-3/makefile
new file mode 100644
index 0000000..3b71b5b
--- /dev/null
+++ b/week-3/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
+