File: Makefile

package info (click to toggle)
hashcash 1.22-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: ansic: 8,565; perl: 925; sh: 297; makefile: 181; python: 41
file content (221 lines) | stat: -rw-r--r-- 6,618 bytes parent folder | download | duplicates (2)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
HC_VERS = 1.22
CHANGEME1 = 1 # put PACKAGER = EBUILD|RPM etc here
CHANGEME2 = 2
CHANGEME3 = 3
INSTALL_PATH = /usr/bin
MAN_INSTALL_PATH = /usr/share/man/man1
DOC_INSTALL_PATH = /usr/share/doc/hashcash-$(HC_VERS)
MAKEDEPEND = makedepend
MSLIB = mslib 
# here you can choose the regexp style your system has
# default is POSIX
# 	REGEXP = -DREGEXP_POSIX
# if no POSIX regexp support, try BSD
# 	REGEXP = -DREGEXP_BSD
# if no POSIX or BSD, disable, still have builtin basic wildcard support
# 	REGEXP = 
REGEXP=-DREGEXP_POSIX
COPT_DEBUG = -g -DDEBUG
COPT_GENERIC = -O3
COPT_GNU = -O3 -funroll-loops
COPT_X86 = -O3 -funroll-loops -march=pentium-mmx -mmmx \
	-D_REENTRANT -D_THREAD_SAFE -fPIC
COPT_MINGW = -O3 -funroll-loops -march=pentium-mmx -mmmx \
        -D_REENTRANT -D_THREAD_SAFE
COPT_G3_OSX = -O3 -funroll-loops -fno-inline -mcpu=750 -faltivec
COPT_PPC_LINUX = -O3 -funroll-loops -fno-inline -mcpu=604e -maltivec \
	-mabi=altivec
LIB=.a
# request static link of -lcrypto only
LIBCRYPTO=/usr/lib/libcrypto.a
EXES = hashcash$(EXE)
INSTALL = install
POD2MAN = pod2man
POD2HTML = pod2html
POD2TEXT = pod2text
DELETE = rm -f
ETAGS = etags
FASTLIBS = libfastmint.o fastmint_mmx_standard_1.o fastmint_mmx_compact_1.o \
	fastmint_ansi_compact_1.o fastmint_ansi_standard_1.o \
	fastmint_ansi_compact_2.o fastmint_ansi_standard_2.o \
	fastmint_altivec_standard_1.o fastmint_altivec_standard_2.o \
	fastmint_altivec_compact_2.o fastmint_ansi_ultracompact_1.o \
	fastmint_library.o
OBJS = libsha1.o libhc.o sdb.o lock.o utct.o random.o sstring.o \
	$(FASTLIBS)
LIBOBJS = libhc.o libsha1.o utct.o sdb.o lock.o sstring.o random.o $(FASTLIBS)
EXEOBJS = hashcash.o

DIST = ../dist.csh

default:	help generic

help:
	@echo "make <platform> where platform is:"
	@echo "    x86, mingw, mingw-dll, g3-osx, ppc-linux, gnu, generic, debug"
	@echo "or to link with openSSL for SHA1 rather than builtin:"
	@echo "    x86-openssl, g3-osx-openssl, ppc-linux-openssl, "
	@echo "    gnu-openssl, generic-openssl, debug-openssl"
	@echo "other make targets are docs, install, clean, distclean, docclean"
	@echo ""
	@echo "(doing make generic by default)"
	@echo ""

generic:
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_GENERIC) $(COPT)" build

debug:
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_DEBUG) $(COPT)" build

gnu:
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_GNU) $(COPT)" "CC=gcc" build

x86: 
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_X86) $(COPT)" build

g3-osx:
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_G3_OSX) $(COPT)" build

ppc-linux:
	$(MAKE) "CFLAGS=$(CFLAGS) $(REGEXP) $(COPT_PPC_LINUX) $(COPT)" build

# mingw windows targets (cross compiler, or native)

mingw:
	$(MAKE) "LIB=.lib" "CC=gcc" "EXE=.exe" "CFLAGS=$(COPT_MINGW) -DMONOLITHIC $(COPT)" build

mingw-dll:
	$(MAKE) "CC=gcc" "EXE=.exe" "CFLAGS=$(COPT_MINGW) $(COPT)" build-dll


# openSSL versions of targets

x86-openssl:
	$(MAKE) x86 "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"

g3-osx-openssl:
	$(MAKE) g3-osx "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"

ppc-linux-openssl:
	$(MAKE) ppc-linux "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"

gnu-openssl:
	$(MAKE) gnu "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"

generic-openssl:
	$(MAKE) generic "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"

debug-openssl:
	$(MAKE) debug "CFLAGS=$(CFLAGS) -DOPENSSL" "LDFLAGS=$(LDFLAGS) $(LIBCRYPTO)"


build:	hashcash$(EXE)

build-dll:      hashcash-dll$(EXE) sha1$(EXE)

hashcash$(EXE):	hashcash.o libhashcash$(LIB)
	$(CC) hashcash.o libhashcash$(LIB) -o $@ $(LDFLAGS)

sha1$(EXE):	sha1.o libsha1.o
	$(CC) sha1.o libsha1.o -o $@ $(LDFLAGS)

example$(EXE):	example.o getopt.o libhashcash$(LIB)
	$(CC) example.o getopt.o libhashcash$(LIB) $(LIBCRYPTO) -o $@ $(LDFLAGS) 

hashcash-dll$(EXE):   $(EXEOBJS) hashcash.dll
	$(CC) $(EXEOBJS) hashcash.dll -o $@ $(LDFLAGS)

sha1test$(EXE):	sha1test.o libsha1.o
	$(CC) sha1test.o libsha1.o -o $@ $(LDFLAGS)

all:	$(EXES)

libhashcash$(LIB):	$(LIBOBJS)
	$(DELETE) $@
	$(AR) rcs $@ $(LIBOBJS)

hashcash.dll:   $(LIBOBJS)
	$(CC) -shared -o hashcash.dll $(LIBOBJS) \
	-Wl,--output-def,hashcash.def,--out-implib,libhashcash.a
	$(MSLIB) /machine:x86 /def:hashcash.def

docs:	hashcash.1 hashcash.html hashcash.txt sha1-hashcash.1 \
	sha1-hashcash.html sha1-hashcash.txt

hashcash.1:	hashcash.pod
	$(POD2MAN) -s 1 -c hashcash -r $(HC_VERS) $? > $@

hashcash.html:	hashcash.pod
	$(POD2HTML) --title hashcash $? > $@
	$(DELETE) pod2htm*

hashcash.txt: hashcash.pod
	$(POD2TEXT) $? > $@

sha1-hashcash.1:	sha1-hashcash.pod
	$(POD2MAN) -s 1 -c sha1 -r $(HC_VERS) $? > $@

sha1-hashcash.html:	sha1-hashcash.pod
	$(POD2HTML) --title sha1 $? > $@
	$(DELETE) pod2htm*

sha1-hashcash.txt: sha1-hashcash.pod
	$(POD2TEXT) $? > $@

install:	hashcash
	$(INSTALL) -d $(DESTDIR)/usr/bin
	$(INSTALL) ./hashcash $(DESTDIR)/usr/bin
	$(INSTALL) -d $(DESTDIR)$(MAN_INSTALL_PATH)
	$(INSTALL) -m 644 hashcash.1 $(DESTDIR)$(MAN_INSTALL_PATH)
	# $(INSTALL) -d $(DOC_INSTALL_PATH)
	# $(INSTALL) -m 644 README LICENSE CHANGELOG $(DOC_INSTALL_PATH)

depend:
	$(MAKEDEPEND) -- -Y *.c *.h

docclean:
	$(DELETE) hashcash.txt hashcash.1 hashcash.html pod2htm*
	$(DELETE) sha1-hashcash.txt sha1-hashcash.1 sha1-hashcash.html

clean:
	$(DELETE) *.o *~

distclean:
	$(DELETE) *.o *~ $(EXES) hashcash-dll.* *.db *.bak TAGS core* 
	$(DELETE) *.bak test/* *.dll *.lib *.exe *.a *.sdb

tags:
	$(ETAGS) *.c *.h

dist:	
	$(DIST)

# DO NOT DELETE

example.o: sstring.h sdb.h hashcash.h getopt.h
fastmint_altivec_compact_2.o: libfastmint.h hashcash.h
fastmint_altivec_standard_1.o: libfastmint.h hashcash.h
fastmint_altivec_standard_2.o: libfastmint.h hashcash.h
fastmint_ansi_compact_1.o: libfastmint.h hashcash.h
fastmint_ansi_compact_2.o: libfastmint.h hashcash.h
fastmint_ansi_standard_1.o: libfastmint.h hashcash.h
fastmint_ansi_standard_2.o: libfastmint.h hashcash.h
fastmint_ansi_ultracompact_1.o: libfastmint.h hashcash.h
fastmint_library.o: sha1.h types.h libfastmint.h hashcash.h
fastmint_mmx_compact_1.o: libfastmint.h hashcash.h
fastmint_mmx_standard_1.o: libfastmint.h hashcash.h
getopt.o: getopt.h
hashcash.o: sdb.h utct.h random.h hashcash.h libfastmint.h sstring.h
hashcash.o: sha1.h types.h
libfastmint.o: random.h sha1.h types.h libfastmint.h hashcash.h
libhc.o: hashcash.h utct.h libfastmint.h sha1.h types.h random.h sstring.h
libsha1.o: sha1.h types.h
lock.o: lock.h
random.o: random.h sha1.h types.h
sdb.o: types.h lock.h sdb.h utct.h
sha1.o: sha1.h types.h
sha1test.o: sha1.h types.h
sstring.o: sstring.h
utct.o: sstring.h utct.h
libfastmint.o: hashcash.h
sha1.o: types.h