forked from xsgordon/duplo-fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (31 loc) · 958 Bytes
/
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
# Compiler
CXX = g++
# Flags
CXXFLAGS = -O3 -Wall -Wextra
LDFLAGS = ${CXXFLAGS}
# Define what extensions we use
.SUFFIXES : .cpp
# Name of executable
PROG_NAME = duplo
PREFIX=/usr/local
# List of object files
OBJS = StringUtil.o HashUtil.o ArgumentParser.o TextFile.o \
SourceFile.o SourceLine.o Duplo.o FileType.o
# Build process
all: ${PROG_NAME} ${PROG_NAME}.1.gz
# Link
${PROG_NAME}: ${OBJS}
${CXX} ${LDFLAGS} -o ${PROG_NAME} ${OBJS}
${PROG_NAME}.1.gz: ${PROG_NAME}.1
gzip -c ${PROG_NAME}.1 > ${PROG_NAME}.1.gz
install: duplo duplo.1.gz
install -m 0755 duplo ${PREFIX}/bin
install -d ${PREFIX}/share/docs/duplo
install -m 0644 README ${PREFIX}/share/docs/duplo
install -m 0644 README ${PREFIX}/share/docs/duplo
install -m 0644 duplo.1.gz ${PREFIX}/share/man/man1
# Remove all object files and gzipped man page.
clean:
rm -f ./*.o
rm -f ./${PROG_NAME}.1.gz
rm -f ./${PROG_NAME}