aboutsummaryrefslogtreecommitdiff
path: root/week-2/makefile
diff options
context:
space:
mode:
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
+