| 1 | ################################################################# |
|---|
| 2 | # 2005-08-22 |
|---|
| 3 | # This is a makefile for compiling E3 in the floppyFW dev-kit. |
|---|
| 4 | # |
|---|
| 5 | # Kai Ove Gran |
|---|
| 6 | # kaiove@humla.no |
|---|
| 7 | ################################################################# |
|---|
| 8 | |
|---|
| 9 | # Setting our variables. |
|---|
| 10 | |
|---|
| 11 | E3_SOURCE_URL=http://mitglied.lycos.de/albkleine/ |
|---|
| 12 | E3_VERSION=2.7.1 |
|---|
| 13 | E3_SOURCE=e3-$(E3_VERSION).tar.gz |
|---|
| 14 | E3_DIR=$(BUILD_DIR)/e3-$(E3_VERSION) |
|---|
| 15 | E3_PKG_DIR=$(PACKAGES_DIR)/e3 |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | # Downloading the source. |
|---|
| 19 | |
|---|
| 20 | $(DL_DIR)/$(E3_SOURCE): |
|---|
| 21 | $(WGET) -P $(DL_DIR) $(E3_SOURCE_URL)$(E3_SOURCE) |
|---|
| 22 | |
|---|
| 23 | # Makes it possible to write 'make e3-source' from floppyfw |
|---|
| 24 | # directory to download source only. |
|---|
| 25 | |
|---|
| 26 | e3-source: $(DL_DIR)/$(E3_SOURCE) |
|---|
| 27 | |
|---|
| 28 | # Unpacks the source from the download directory to the |
|---|
| 29 | # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the |
|---|
| 30 | # E3_DIR is because the files are packed in a folder within |
|---|
| 31 | # the tarball, thus ending up in the E3_DIR when unpacked. |
|---|
| 32 | |
|---|
| 33 | $(E3_DIR)/.unpacked: $(DL_DIR)/$(E3_SOURCE) |
|---|
| 34 | # PLEASE NOTE! This is a temporary patch which can be removed when this bug is fixed in the general makefile!! |
|---|
| 35 | @mkdir -p $(E3_PKG_DIR)/bin |
|---|
| 36 | # ^-- This one that is ;) |
|---|
| 37 | zcat $(DL_DIR)/$(E3_SOURCE) | \ |
|---|
| 38 | tar $(TAR_VERBOSE) -C $(BUILD_DIR) -xf - |
|---|
| 39 | touch $(E3_DIR)/.unpacked |
|---|
| 40 | |
|---|
| 41 | # Runs the make. Copies the finished binary to the package dir. |
|---|
| 42 | |
|---|
| 43 | $(E3_PKG_DIR)/bin/e3: $(E3_DIR)/.unpacked |
|---|
| 44 | $(MAKE) -C $(E3_DIR) |
|---|
| 45 | if [ ! -d $(E3_PKG_DIR)/bin ]; then mkdir -p $(E3_PKG_DIR)/bin;fi |
|---|
| 46 | mv $(E3_DIR)/e3 $(E3_PKG_DIR)/bin/e3 |
|---|
| 47 | mv $(E3_DIR)/e3em $(E3_PKG_DIR)/bin/e3em |
|---|
| 48 | mv $(E3_DIR)/e3ne $(E3_PKG_DIR)/bin/e3ne |
|---|
| 49 | mv $(E3_DIR)/e3pi $(E3_PKG_DIR)/bin/e3pi |
|---|
| 50 | mv $(E3_DIR)/e3vi $(E3_PKG_DIR)/bin/e3vi |
|---|
| 51 | mv $(E3_DIR)/e3ws $(E3_PKG_DIR)/bin/e3ws |
|---|
| 52 | |
|---|
| 53 | # Makes the bz2 and ffw files and places them under |
|---|
| 54 | # /floppyfw/packages. |
|---|
| 55 | |
|---|
| 56 | $(PACKAGES_DIR)/e3.bz2: $(E3_PKG_DIR)/bin/e3 |
|---|
| 57 | (cd $(PACKAGES_DIR); sh mkpack e3) |
|---|
| 58 | |
|---|
| 59 | # Makes it possible to write 'make e3' from the floppyfw dir. |
|---|
| 60 | |
|---|
| 61 | e3: $(PACKAGES_DIR)/e3.bz2 |
|---|
| 62 | |
|---|
| 63 | # Makes it possible to write 'make e3-clean' from the floppyfw |
|---|
| 64 | # dir to remove everything related to e3. |
|---|
| 65 | |
|---|
| 66 | e3-clean: |
|---|
| 67 | $(MAKE) -C $(E3_DIR) clean |
|---|
| 68 | $(RM) -r $(E3_PKG_DIR) |
|---|
| 69 | |
|---|
| 70 | e3-dirclean: |
|---|
| 71 | $(RM) -r $(E3_DIR) |
|---|
| 72 | $(RM) -r $(E3_PKG_DIR) |
|---|
| 73 | $(RM) -r $(DL_DIR)/$(E3_SOURCE) |
|---|