File: Makefile

package info (click to toggle)
snowdrop 0.02b-15
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 352 kB
  • sloc: ansic: 3,455; makefile: 240
file content (83 lines) | stat: -rw-r--r-- 3,012 bytes parent folder | download | duplicates (4)
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
#
#  snowdrop - text watermarking and watermark recovery
#  ---------------------------------------------------
#
#  Copyright (C) 2002 by Michal Zalewski <lcamtuf@coredump.cx>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  As a special exception, this program may be linked with the
#  OpenSSL library, despite that library's more restrictive license.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

VER	= 0.02b
LANG    = eng engf c

BINROOT = /usr/bin/
DESTDIR = /

CFLAGS  += -ggdb -O2 -fomit-frame-pointer -funroll-loops -fexpensive-optimizations \
          -ffast-math -Wall -g
LDFLAGS += -Wl,--as-needed


all: modules snowdrop toinstall

modules: language.h
	echo ; \
	echo "[*] Compiling language modules:" ; \
	test -f /usr/include/gnutls/openssl.h && USEOPENSSL=1; \
	test -f /usr/local/include/gnutls/openssl.h && USEOPENSSL=1; \
	test "$$USEOPENSSL" = "" || echo "[+] Using GNU TLS MD5 modules." ; \
	test "$$USEOPENSSL" = "" && echo "[+] Trying to use RSA MD5 modules." ; \
	for i in $(LANG); do \
	  echo "[+] Building language module for '$$i'..."; \
	  test "$$USEOPENSSL" = "" || ADDME="-DUSE_OPENSSL -DUSE_GNUTLS" ; \
	  $(CC) $$ADDME $(CFLAGS) $(CPPFLAGS) -c lang-$$i.c -o lang-$$i.o || exit 1; \
	done; \
	echo "[*] Language modules compiled."

snowdrop: snowdrop.c language.h 
	echo "[*] Compiling main code:"; \
	test -f /usr/include/gnutls/openssl.h && USEOPENSSL=1; \
	test -f /usr/local/include/gnutls/openssl.h && USEOPENSSL=1; \
	for i in $(LANG); do \
	  echo "[+] Building 'sd-$$i'..." ; \
	  ADDME="-lmd5"; \
	  test "$$USEOPENSSL" = "" || ADDME="-DUSE_OPENSSL -DUSE_GNUTLS -lgnutls-openssl $(shell pkg-config --libs --cflags gnutls)" ; \
	  $(CC) $(LDFLAGS) -DVER=\"$(VER)\" $(CFLAGS) $(CPPFLAGS) -DTARGETLANG=\"$$i\" snowdrop.c lang-$$i.o -o sd-$$i $$ADDME || exit 1; \
	done; \
	echo "[*] Main code compiled."

toinstall:
	@echo "Type 'make install' to install binaries in $(BINROOT)."
	@echo


clean:
	rm -f sd-* *.o core core.* a.out

install:
	@echo "[*] Installing binaries in $(DESTDIR)$(BINROOT)..."
	cp -f sd-* $(DESTDIR)$(BINROOT)
	@echo "[*] Installing synonyms database..."
	@mkdir $(DESTDIR)/usr/share/snowdrop || true
	cp synonyms $(DESTDIR)/usr/share/snowdrop/
	@echo "[*] Installation complete."

publish: clean
	@ tar cfvz /snowdrop.tgz /snowdrop; \
	  scp -p /snowdrop.tgz lcamtuf@coredump.cx:/export/www/lcamtuf/snowdrop.tgz; \
	  rm -f /snowdrop.tgz