-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (56 loc) · 1.19 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
71
72
73
74
75
76
77
78
# Time-stamp: <2016-03-16 16:26:21 dmendyke>
#
# Makefile: Builds the classic project
#
##
# Macros
cc := /usr/bin/g++
ccflags := -g -std=c++14 -I/home/dmendyke/dev/cc/ct
sh := /bin/bash
RM := /bin/rm
ARFLAGS := rcs
AR := /usr/bin/ar $(ARFLAGS)
dep := $(sh) ./tools/dep.sh
##
# Rules
%.d : %.cc ; $(dep) $<
%.o : %.cc ; $(cc) $(ccflags) -c -o $@ $<
##
files = chance name hex universe agent ship fleet \
combatant line battle application main
##
# Empty macros
dependents =
lib =
libobjs =
cleanable =
##
target := parsec
source = $(addsuffix .cc,$(files))
objects += $(source:.cc=.o)
dependents += $(source:.cc=.d)
cleanable += $(objects) $(target)
##
# Main target
all : $(target) $(dependents) ; @echo Build Completed
##
#includes
include metric/module.mk
include $(dependents)
##
# Main target
$(target) : $(objects) $(libobjs) ; $(cc) $(ccflags) -o $@ $(objects) $(lib)
##
# Run the application and dump the log file
.PHONEY: run
run : ; @./$(target)
#run : ; @./$(target) && cat log.out
##
# Remove build files
.PHONEY: clean
clean : ; $(RM) --force $(cleanable)
nuke : clean ; $(RM) --force $(dependents)
##
# Remove just the dependent files
.PHONEY: wipe
wipe : ; $(RM) --force *.d