-
Notifications
You must be signed in to change notification settings - Fork 80
/
Makefile
79 lines (59 loc) · 1.77 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
79
# eschalot Makefile
# If you modify the Makefile, please make sure it works with
# both BSD and GNU makes. Avoid the fancy features.
PROG1 ?= eschalot
PROG2 ?= worgen
PROG3 ?= typecard
PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
LIBS += -lpthread -lssl -lcrypto
WARNINGS += -Wall -W -Wunused -pedantic -Wpointer-arith \
-Wreturn-type -Wstrict-prototypes \
-Wmissing-prototypes -Wshadow -Wcast-qual -Wextra
CFLAGS += -std=c99
CFLAGS += -O2
CFLAGS += -fPIC
CFLAGS += -finline-functions
#CFLAGS += -fomit-frame-pointer
#CFLAGS += -m64
#CFLAGS += -mtune=native -march=native
#CFLAGS += -g
DEBUGFLAGS += -g -rdynamic
ifneq ($(OS),Windows_NT)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIBS += -L/usr/local/opt/openssl/lib
CFLAGS += -I/usr/local/opt/openssl/include
endif
endif
CC ?= cc
INSTALL ?= install -c -o root -g bin -m 755
RM ?= /bin/rm -f
all: ${PROG1} ${PROG2}
${PROG1}: ${PROG1}.c Makefile
${CC} ${CFLAGS} ${WARNINGS} -o $@ ${PROG1}.c ${LIBS}
${PROG2}: ${PROG2}.c Makefile
${CC} ${CFLAGS} ${WARNINGS} -o $@ ${PROG2}.c
# make typecard - quick overview of the basic types on the system
${PROG3}: ${PROG3}.c Makefile
${CC} ${CFLAGS} -o $@ ${PROG3}.c
./${PROG3}
install: all
${INSTALL} ${PROG1} ${BINDIR}
${INSTALL} ${PROG2} ${BINDIR}
clean:
${RM} ${PROG1} ${PROG2} ${PROG3} *.o *.p *.d *.s *.S *~ *.core .depend
# Simple procedure to speed up basic testing on multiple platforms
WF1 = top150adjectives.txt
WF2 = top400nouns.txt
WF3 = top1000.txt
WLIST = wordlist.txt
RESULTS = results.txt
test: all
./${PROG2} 8-16 ${WF1} 3-16 ${WF2} 3-16 ${WF3} 3-16 > ${WLIST}
./${PROG1} -vct4 -f ${WLIST} >> ${RESULTS}
cleantest:
${RM} ${WLIST} ${RESULTS}
cleanall: clean cleantest
debug: CFLAGS += ${DEBUGFLAGS}
debug: all