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