-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (30 loc) · 726 Bytes
/
Makefile
File metadata and controls
36 lines (30 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Follow the coding style written in the official GNU make document.
# https://www.gnu.org/software/make/manual/make.html
# Use C++ mainly, and use C as partly.
CXX = g++
CC = gcc
# CFLAGS: For C only.
# CXXFLAGS: For C++ only.
# CPPFLAGS: The CPP means "C PreProcessor". For both C and C++.
# https://stackoverflow.com/questions/495598/
CXXFLAGS = -g
CFLAGS = $(CXXFLAGS)
CPPFLAGS =
INCLUDES =
OBJS =
EXE = hello
LIBS =
.cpp.o :
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
.c.o :
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
.PHONY : all
all : $(EXE)
$(EXE) : $(OBJS) main.o
$(CXX) $(CXXFLAGS) $^ -o $@ $(LIBS)
.PHONY : clean
clean :
rm -f *.o $(EXE)
.PHONY : test
test : all
echo "Run the test"