-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 1.03 KB
/
Makefile
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
51
52
#===========================================================================
#
# Makefile for tsh project --
#
#===========================================================================
BIN = tsh
ENDLESS = endless
SLOW = slow
CPP = g++
CPPFLAGS = -D_GNU_SOURCE -Wall -g
LNFLAGS = -Wall
CPPFILES := $(wildcard *.cpp)
OBJS := $(CPPFILES:.cpp=.o)
HEADERS := $(wildcard *.h)
%.o: %.cpp
@echo "Compiling $<..."
@$(CPP) $(CPPFLAGS) -c $<
all: $(BIN) $(ENDLESS) $(SLOW)
$(ENDLESS): $(ENDLESS).c
@echo "Building endless..."
@$(CPP) $(ENDLESS).c -o $(ENDLESS)
$(SLOW): $(SLOW).c
@echo "Building slow..."
@$(CPP) $(SLOW).c -o $(SLOW)
$(BIN): $(OBJS)
@echo "Linking $@..."
@$(CPP) $(LNFLAGS) -o $@ $(OBJS)
$(OBJS): $(HEADERS)
clean:
@echo "Cleaning files..."
@-rm *.o *~ $(BIN) $(SLOW) $(ENDLESS)
#
# Bedeutung Makefile Makros:
#
# $< the name of the related file that caused the action.
# $* the prefix shared by target and dependent files.
# $@ is the name of the file to be made.
# $? is the names of the changed dependents.