~voidraven/scry

ref: e964c0edad506744c580f80b680765ff8cda97be scry/makefile -rw-r--r-- 1.1 KiB
e964c0edvoidraven rename build file 5 months ago
                                                                                
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
CXX=c++
RM=rm -f
PREFIX=/usr/local
CXXFLAGS=--std=c++14 -pedantic -Wall -Wextra
LDFLAGS = -I include
LDFLAGS += -I tests
LDFLAGS += -I $(PREFIX)/include
LDLIBS=-L$(PREFIX)/lib -lscrypt

.POSIX: all debug opt

all: scry

debug: CXXFLAGS += -save-temps -g -O0
debug: clean scry

opt: CXXFLAGS += --pipe -O2 -fpie -march=native -fstack-protector-strong
opt: LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now
opt: clean scry

scry: scry.o main.o
	$(CXX) $(LDFLAGS) -o scry scry.o main.o $(LDLIBS)

scry.o: scry.cpp
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CPPFLAGS) -c scry.cpp

main.o: main.cpp
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CPPFLAGS) -c main.cpp

clean:
	$(RM) *.o *.s *.ii

distclean: clean
	$(RM) *~ *.tar.gz scry test_scry

test: test_scry.o scry.o
	$(CXX) $(LDFLAGS) -o test_scry scry.o test_scry.o $(LDLIBS)

test_scry.o: tests/test_scry.cpp
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CXXFLAGS) -c tests/test_scry.cpp

#install
#> install on users system

#uninstall
#> exact opposite of install

# make a source archive for distribution
dist: distclean
	tar -czvf ../scry-source.tar.gz ./
	mv ../scry-source.tar.gz ./