| 1 | ################################################################# |
|---|
| 2 | # Started 2007-08-17 |
|---|
| 3 | # Last modified 2007-08-17 |
|---|
| 4 | # |
|---|
| 5 | # This is a makefile for compiling micro_proxy for floppyFW. |
|---|
| 6 | # It requires inetd to be compiled in floppyfw. |
|---|
| 7 | # |
|---|
| 8 | # Kai Ove Gran |
|---|
| 9 | # kaiove@humla.no |
|---|
| 10 | ################################################################# |
|---|
| 11 | |
|---|
| 12 | # Setting our variables. |
|---|
| 13 | |
|---|
| 14 | MICRO_PROXY_SOURCE_URL=http://www.acme.com/software/micro_proxy/ |
|---|
| 15 | MICRO_PROXY_SOURCE=micro_proxy_30oct2002.tar.gz |
|---|
| 16 | MICRO_PROXY_DIR=$(BUILD_DIR)/micro_proxy |
|---|
| 17 | MICRO_PROXY_PKG_DIR=$(PACKAGES_DIR)/micro_proxy |
|---|
| 18 | |
|---|
| 19 | # Downloading the source. |
|---|
| 20 | |
|---|
| 21 | $(DL_DIR)/$(MICRO_PROXY_SOURCE): |
|---|
| 22 | $(WGET) -P $(DL_DIR) $(MICRO_PROXY_SOURCE_URL)$(MICRO_PROXY_SOURCE) |
|---|
| 23 | |
|---|
| 24 | # Makes it possible to write 'make micro_proxy-source' from floppyfw |
|---|
| 25 | # directory to download source only. |
|---|
| 26 | |
|---|
| 27 | micro_proxy-source: $(DL_DIR)/$(MICRO_PROXY_SOURCE) |
|---|
| 28 | |
|---|
| 29 | # Unpacks the source from the download directory to the |
|---|
| 30 | # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the |
|---|
| 31 | # MICRO_PROXY_DIR is because the files are packed in a folder within |
|---|
| 32 | # the tarball, thus ending up in the MICRO_PROXY_DIR when unpacked. |
|---|
| 33 | |
|---|
| 34 | $(MICRO_PROXY_DIR)/.unpacked: $(DL_DIR)/$(MICRO_PROXY_SOURCE) |
|---|
| 35 | # PLEASE NOTE! This is a small patch that allowes this makefile to run from devkit even if we are not compiling floppyfw. |
|---|
| 36 | if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR);fi |
|---|
| 37 | # ^-- This one that is ;) |
|---|
| 38 | tar -C $(BUILD_DIR) -xvzf $(DL_DIR)/$(MICRO_PROXY_SOURCE) |
|---|
| 39 | touch $(MUNINLITE_DIR)/.unpacked |
|---|
| 40 | |
|---|
| 41 | # Makes floppyfw specific changes to micro_proxy's Makefile |
|---|
| 42 | # Makes the /usr/bin folder |
|---|
| 43 | |
|---|
| 44 | $(MICRO_PROXY_DIR)/.configured: $(MICRO_PROXY_DIR)/.unpacked |
|---|
| 45 | if [ ! -d $(MICRO_PROXY_PKG_DIR)/usr/bin ]; then mkdir -p $(MICRO_PROXY_PKG_DIR)/usr/bin;fi |
|---|
| 46 | $(SED) "s/^BINDIR\ \=\t\/usr\/local\/sbin/BINDIR\ \=\t\/usr\/bin/" $(MICRO_PROXY_DIR)/Makefile |
|---|
| 47 | touch $(MICRO_PROXY_DIR)/.configured |
|---|
| 48 | |
|---|
| 49 | # Runs the make. Copies the finished binary to the package dir. |
|---|
| 50 | |
|---|
| 51 | $(MICRO_PROXY_PKG_DIR)/usr/bin/micro_proxy: $(MICRO_PROXY_DIR)/.configured |
|---|
| 52 | $(MAKE) -C $(MICRO_PROXY_DIR) |
|---|
| 53 | cp $(MICRO_PROXY_DIR)/micro_proxy $(MICRO_PROXY_PKG_DIR)/usr/bin/micro_proxy |
|---|
| 54 | mkdir -p $(MICRO_PROXY_PKG_DIR)/etc/. |
|---|
| 55 | cp $(PACKAGES_DIR)/scripts/post-micro_proxy.ini $(MICRO_PROXY_PKG_DIR)/etc/. |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | # Makes the bz2 and ffw package files and places them under |
|---|
| 59 | # /floppyfw/packages. |
|---|
| 60 | |
|---|
| 61 | $(PACKAGES_DIR)/micro_proxy.ffw: $(MICRO_PROXY_PKG_DIR)/usr/bin/micro_proxy |
|---|
| 62 | # here we should copy the .ini-file... Needs to be fixed. |
|---|
| 63 | (cd $(PACKAGES_DIR); sh mkpack micro_proxy) |
|---|
| 64 | |
|---|
| 65 | # Makes it possible to write 'make micro_proxy' from the floppyfw |
|---|
| 66 | # dir. |
|---|
| 67 | |
|---|
| 68 | micro_proxy: $(PACKAGES_DIR)/micro_proxy.ffw |
|---|
| 69 | |
|---|
| 70 | # Makes it possible to write 'make micro_proxy-clean' from the |
|---|
| 71 | # floppyfw dir to remove everything related to muninlite. |
|---|
| 72 | |
|---|
| 73 | micro_proxy-clean: |
|---|
| 74 | $(RM) -r $(MICRO_PROXY_DIR) |
|---|
| 75 | $(RM) -r $(MICRO_PROXY_PKG_DIR) |
|---|
| 76 | $(RM) -r $(DL_DIR)/$(MICRO_PROXY_SOURCE) |
|---|