| 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-android: |
|---|
| 23 | @(cd src; $(MAKE) base64u.c base64u.h) |
|---|
| 24 | @(cd src; ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk) |
|---|
| 25 | |
|---|
| 26 | cross-android-dist: |
|---|
| 27 | @rm -rf iodine-latest-android* |
|---|
| 28 | @mkdir -p iodine-latest-android/armeabi iodine-latest-android/x86 |
|---|
| 29 | @$(MAKE) cross-android TARGET_ARCH_ABI=armeabi |
|---|
| 30 | @cp src/libs/armeabi/* iodine-latest-android/armeabi |
|---|
| 31 | @$(MAKE) cross-android TARGET_ARCH_ABI=x86 |
|---|
| 32 | @cp src/libs/x86/* iodine-latest-android/x86 |
|---|
| 33 | @cp README README-android.txt CH* TO* iodine-latest-android |
|---|
| 34 | @echo "Create date: " > iodine-latest-android/VERSION |
|---|
| 35 | @date >> iodine-latest-android/VERSION |
|---|
| 36 | @echo "Git version: " >> iodine-latest-android/VERSION |
|---|
| 37 | @git rev-parse HEAD >> iodine-latest-android/VERSION |
|---|
| 38 | @zip -r iodine-latest-android.zip iodine-latest-android |
|---|
| 39 | |
|---|
| 40 | cross-mingw: |
|---|
| 41 | @(cd src; $(MAKE) TARGETOS=windows32 CC=i686-mingw32-gcc all) |
|---|
| 42 | |
|---|
| 43 | cross-mingw-dist: cross-mingw |
|---|
| 44 | @rm -rf iodine-latest-win32* |
|---|
| 45 | @mkdir -p iodine-latest-win32/bin |
|---|
| 46 | @for i in `ls bin`; do cp bin/$$i iodine-latest-win32/bin/$$i.exe; done |
|---|
| 47 | @cp /usr/i686-mingw32/usr/bin/zlib1.dll iodine-latest-win32/bin |
|---|
| 48 | @cp README README-win32.txt CH* TO* iodine-latest-win32 |
|---|
| 49 | @echo "Create date: " > iodine-latest-win32/VERSION |
|---|
| 50 | @date >> iodine-latest-win32/VERSION |
|---|
| 51 | @echo "Git version: " >> iodine-latest-win32/VERSION |
|---|
| 52 | @git rev-parse HEAD >> iodine-latest-win32/VERSION |
|---|
| 53 | @zip -r iodine-latest-win32.zip iodine-latest-win32 |
|---|
| 54 | |
|---|
| 55 | install: all |
|---|
| 56 | $(MKDIR) $(MKDIR_FLAGS) $(DESTDIR)$(sbindir) |
|---|
| 57 | $(INSTALL) $(INSTALL_FLAGS) bin/iodine $(DESTDIR)$(sbindir)/iodine |
|---|
| 58 | chmod 755 $(DESTDIR)$(sbindir)/iodine |
|---|
| 59 | $(INSTALL) $(INSTALL_FLAGS) bin/iodined $(DESTDIR)$(sbindir)/iodined |
|---|
| 60 | chmod 755 $(DESTDIR)$(sbindir)/iodined |
|---|
| 61 | $(MKDIR) $(MKDIR_FLAGS) $(DESTDIR)$(mandir)/man8 |
|---|
| 62 | $(INSTALL) $(INSTALL_FLAGS) man/iodine.8 $(DESTDIR)$(mandir)/man8/iodine.8 |
|---|
| 63 | chmod 644 $(DESTDIR)$(mandir)/man8/iodine.8 |
|---|
| 64 | |
|---|
| 65 | uninstall: |
|---|
| 66 | $(RM) $(RM_FLAGS) $(DESTDIR)$(sbindir)/iodine |
|---|
| 67 | $(RM) $(RM_FLAGS) $(DESTDIR)$(sbindir)/iodined |
|---|
| 68 | $(RM) $(RM_FLAGS) $(DESTDIR)$(mandir)/man8/iodine.8 |
|---|
| 69 | |
|---|
| 70 | test: all |
|---|
| 71 | @echo "!! The check library is required for compiling and running the tests" |
|---|
| 72 | @echo "!! Get it at http://check.sf.net" |
|---|
| 73 | @(cd tests; $(MAKE) TARGETOS=$(TARGETOS) all) |
|---|
| 74 | |
|---|
| 75 | clean: |
|---|
| 76 | @echo "Cleaning..." |
|---|
| 77 | @(cd src; $(MAKE) clean) |
|---|
| 78 | @(cd tests; $(MAKE) clean) |
|---|
| 79 | @rm -rf bin iodine-latest-win32* iodine-latest-android* |
|---|
| 80 | |
|---|