-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·72 lines (55 loc) · 1.89 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#################################################
# Makefile format
# target: dependencies
# <tab> Command to generate target
#################################################
# -----------------------------------------------
# Super useful shortcuts:
# $@ matches the target;
# $< matches the first dependent
# $^ Matches all dependencies
# -----------------------------------------------
# -----------------------------------------------
# But first, some definitions.
# -----------------------------------------------
# Flag to replace gcc, $(CC) = gcc
CC= gcc
# -----------------------------------------------
# CLEAN definition - git rid of compiled stuff
CLEAN= rm -rf *.o story
CLEANWIN = del /f /s *.o *.exe story
# -----------------------------------------------
# TEST definition - write to file and cat file
TEST= (./story > the_story.txt) ; cat the_story.txt
# -----------------------------------------------DERS.h
# The standard default target is 'all'
# This target has no command, only a dependency.
# We will execute test though, when it's built.
# -----------------------------------------------
all: story
test:
@$(TEST)
# -----------------------------------------------
# When you type 'make clean', you get rid of
# all of the *.o and the 'story' file.
# -----------------------------------------------
clean:
$(CLEAN)
cleanwin:
$(CLEANWIN)
# -----------------------------------------------
# Now we bring in our dependencies.
# 'all' needs 'story.o'. What does story need?
# And how do we make it?
# -----------------------------------------------
story: story.o bpbkt7.o wb334.o
$(CC) -o story $^
# -----------------------------------------------
story.o: story.c
$(CC) -c $^
# -----------------------------------------------
#pawprint.o - where is your .c derived object file - where is your file
bpbkt7.o: sentences/bpbkt7.c
$(CC) -c $<
wb334.o: sentences/wb334.c
$(CC) -c $<