| 1 | ################################################################# |
|---|
| 2 | # 2005-08-06 |
|---|
| 3 | # This is a makefile for compiling noip2 in the floppyFW dev-kit. |
|---|
| 4 | # |
|---|
| 5 | # Kai Ove Gran |
|---|
| 6 | # kaiove@humla.no |
|---|
| 7 | ################################################################# |
|---|
| 8 | |
|---|
| 9 | # Setting our variables. |
|---|
| 10 | |
|---|
| 11 | NOIP2_SOURCE_URL=http://www.onevista.com/ |
|---|
| 12 | NOIP2_SOURCE=noip-2.1.tgz |
|---|
| 13 | NOIP2_DIR=$(BUILD_DIR)/noip-2.0 |
|---|
| 14 | NOIP2_PKG_DIR=$(PACKAGES_DIR)/noip2 |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | # Downloading the source. |
|---|
| 18 | |
|---|
| 19 | $(DL_DIR)/$(NOIP2_SOURCE): |
|---|
| 20 | $(WGET) -P $(DL_DIR) $(NOIP2_SOURCE_URL)$(NOIP2_SOURCE) |
|---|
| 21 | |
|---|
| 22 | # Makes it possible to write 'make noip2-source' from floppyfw |
|---|
| 23 | # directory to download source only. |
|---|
| 24 | |
|---|
| 25 | noip2-source: $(DL_DIR)/$(NOIP2_SOURCE) |
|---|
| 26 | |
|---|
| 27 | # Unpacks the source from the download directory to the |
|---|
| 28 | # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the |
|---|
| 29 | # NOIP2_DIR is because the files are packed in a folder within |
|---|
| 30 | # the tarball, thus ending up in the NOIP2_DIR when unpacked. |
|---|
| 31 | |
|---|
| 32 | $(NOIP2_DIR)/.unpacked: $(DL_DIR)/$(NOIP2_SOURCE) |
|---|
| 33 | # PLEASE NOTE! This is a temporary patch which can be removed when this bug is fixed in the general makefile!! |
|---|
| 34 | if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR);fi |
|---|
| 35 | # ^-- This one that is ;) |
|---|
| 36 | tar -C $(BUILD_DIR) -xvzf $(DL_DIR)/$(NOIP2_SOURCE) |
|---|
| 37 | touch $(NOIP2_DIR)/.unpacked |
|---|
| 38 | |
|---|
| 39 | # Makes floppyfw-specific changes to noip2's Makefile. |
|---|
| 40 | |
|---|
| 41 | $(NOIP2_DIR)/.configured: $(NOIP2_DIR)/.unpacked |
|---|
| 42 | $(SED) "s/^PREFIX=\/usr\/local/PREFIX=\//;" $(NOIP2_DIR)/Makefile |
|---|
| 43 | $(SED) 's/^CONFDIR=\$$\{PREFIX\}\/etc/CONFDIR=\/etc/;' $(NOIP2_DIR)/Makefile |
|---|
| 44 | $(SED) 's/^BINDIR=\$$\{PREFIX\}\/bin/BINDIR=\/bin/;' $(NOIP2_DIR)/Makefile |
|---|
| 45 | touch $(NOIP2_DIR)/.configured |
|---|
| 46 | |
|---|
| 47 | # Runs the make. Copies the finished binary to the package dir. |
|---|
| 48 | |
|---|
| 49 | $(NOIP2_PKG_DIR)/bin/noip2: $(NOIP2_DIR)/.configured |
|---|
| 50 | $(MAKE) -C $(NOIP2_DIR) |
|---|
| 51 | if [ ! -d $(NOIP2_PKG_DIR)/bin ]; then mkdir -p $(NOIP2_PKG_DIR)/bin;fi |
|---|
| 52 | cp $(NOIP2_DIR)/noip2 $(NOIP2_PKG_DIR)/bin/noip2 |
|---|
| 53 | |
|---|
| 54 | # Makes the bz2, ffw and post-noip2 files and places them under |
|---|
| 55 | # /floppyfw/packages. |
|---|
| 56 | |
|---|
| 57 | $(PACKAGES_DIR)/noip2.bz2: $(NOIP2_PKG_DIR)/bin/noip2 |
|---|
| 58 | (cd $(PACKAGES_DIR); sh mkpack noip2) |
|---|
| 59 | |
|---|
| 60 | # Makes it possible to write 'make noip2' from the floppyfw dir. |
|---|
| 61 | |
|---|
| 62 | noip2: $(PACKAGES_DIR)/noip2.bz2 |
|---|
| 63 | |
|---|
| 64 | # Makes it possible to write 'make noip2-clean' from the floppyfw |
|---|
| 65 | # dir to remove everything related to noip2. |
|---|
| 66 | |
|---|
| 67 | noip2-clean: |
|---|
| 68 | $(RM) -r $(NOIP2_DIR) |
|---|
| 69 | $(RM) -r $(NOIP2_PKG_DIR) |
|---|
| 70 | |
|---|
| 71 | noip2-distclean: |
|---|
| 72 | $(RM) -r $(DL_DIR)/$(NOIP2_SOURCE) |
|---|