-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (31 loc) · 998 Bytes
/
Makefile
File metadata and controls
52 lines (31 loc) · 998 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CC = g++
OPT = -O3
#OPT = -g
WARN = -Wall
# You can select a C++ standard using the STD define below. To do so, uncomment (remove leading #) and adjust the standard as needed.
#STD = -std=c++11
CFLAGS = $(OPT) $(WARN) $(STD) $(INC) $(LIB)
# List all your .cc/.cpp files here (source files, excluding header files)
SIM_SRC = sim.cc
# List corresponding compiled object files here (.o files)
SIM_OBJ = sim.o
#################################
# default rule
all: sim
@echo "my work is done here..."
# rule for making sim
sim: $(SIM_OBJ)
$(CC) -o sim $(CFLAGS) $(SIM_OBJ) -lm
@echo "-----------DONE WITH sim-----------"
# generic rule for converting any .cc file to any .o file
.cc.o:
$(CC) $(CFLAGS) -c $*.cc
# generic rule for converting any .cpp file to any .o file
.cpp.o:
$(CC) $(CFLAGS) -c $*.cpp
# type "make clean" to remove all .o files plus the sim binary
clean:
rm -f *.o sim
# type "make clobber" to remove all .o files (leaves sim binary)
clobber:
rm -f *.o