-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 869 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 869 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
# Time-stamp: <2016-01-29 16:00:51 daniel>
# Author: Daniel Mendyke [[email protected]]
#
# Makefile: Build system for sample
#
## Macros
RM := /bin/rm
CC := /usr/bin/g++
CCFLAGS := -std=c++11 -g
SH := /bin/bash
VAL := /usr/bin/valgrind
## Special Rules
%.d : %.cc ; $(SH) dep.sh $<
%.o : %.cc ; $(CC) $(CCFLAGS) -o $@ -c $<
## Variables
target = exercise
src = main.cc application.cc stack.cc fifo.cc
objs = $(src:.cc=.o)
deps = $(src:.cc=.d)
## default target
all : $(target) $(deps) ; @echo Build Complete
## Run with valgrind
run : $(target) ; $(VAL) ./$(target)
## add rules for each object
include $(deps)
## clean: remove target and object files
## nuke: remove everything built by 'make'
.PHONEY: clean
clean : ; $(RM) --force $(objs)
nuke : clean ; $(RM) --force $(deps) $(target)
## build main target
$(target) : $(objs) ; $(CC) $(CCFLAGS) -o $@ $^