Set urgency=high.
[debian/iodine.git] / Makefile
1 prefix=/usr/local
2 sbindir=$(prefix)/sbin
3 datadir=$(prefix)/share
4 mandir=$(datadir)/man
5
6 DESTDIR=
7
8 INSTALL=install
9 INSTALL_FLAGS=
10
11 MKDIR=mkdir
12 MKDIR_FLAGS=-p
13
14 RM=rm
15 RM_FLAGS=-f
16
17 TARGETOS = `uname`
18
19 all: 
20         @(cd src; $(MAKE) TARGETOS=$(TARGETOS) all)
21
22 cross-mingw: 
23         @(cd src; $(MAKE) TARGETOS=windows32 CC=i686-mingw32-gcc all)
24
25 cross-mingw-dist: cross-mingw
26         @rm -rf iodine-latest-win32*
27         @mkdir -p iodine-latest-win32/bin
28         @for i in `ls bin`; do cp bin/$$i iodine-latest-win32/bin/$$i.exe; done
29         @cp /usr/i686-mingw32/usr/bin/zlib1.dll iodine-latest-win32/bin
30         @cp README* CH* TO* iodine-latest-win32
31         @echo "Create date: " > iodine-latest-win32/VERSION
32         @date >> iodine-latest-win32/VERSION
33         @echo "SVN version: " >> iodine-latest-win32/VERSION
34         @svnversion >> iodine-latest-win32/VERSION
35         @zip -r iodine-latest-win32.zip iodine-latest-win32
36
37 install: all
38         $(MKDIR) $(MKDIR_FLAGS) $(DESTDIR)$(sbindir)
39         $(INSTALL) $(INSTALL_FLAGS) bin/iodine $(DESTDIR)$(sbindir)/iodine
40         chmod 755 $(DESTDIR)$(sbindir)/iodine
41         $(INSTALL) $(INSTALL_FLAGS) bin/iodined $(DESTDIR)$(sbindir)/iodined
42         chmod 755 $(DESTDIR)$(sbindir)/iodined
43         $(MKDIR) $(MKDIR_FLAGS) $(DESTDIR)$(mandir)/man8
44         $(INSTALL) $(INSTALL_FLAGS) man/iodine.8 $(DESTDIR)$(mandir)/man8/iodine.8
45         chmod 644 $(DESTDIR)$(mandir)/man8/iodine.8
46
47 uninstall:
48         $(RM) $(RM_FLAGS) $(DESTDIR)$(sbindir)/iodine
49         $(RM) $(RM_FLAGS) $(DESTDIR)$(sbindir)/iodined
50         $(RM) $(RM_FLAGS) $(DESTDIR)$(mandir)/man8/iodine.8
51         
52 test: all
53         @echo "!! The check library is required for compiling and running the tests"
54         @echo "!! Get it at http://check.sf.net"
55         @(cd tests; $(MAKE) TARGETOS=$(TARGETOS) all)
56
57 clean:
58         @echo "Cleaning..."
59         @(cd src; $(MAKE) clean)
60         @(cd tests; $(MAKE) clean)
61         @rm -rf bin iodine-latest-win32*
62