| 1 | ################################################################# |
|---|
| 2 | # 2007-01-14 |
|---|
| 3 | # This is a makefile for compiling nanotop in the floppyFW |
|---|
| 4 | # dev-kit. |
|---|
| 5 | # |
|---|
| 6 | # Kai Ove Gran |
|---|
| 7 | # kaiove@humla.no |
|---|
| 8 | ################################################################# |
|---|
| 9 | |
|---|
| 10 | # Setting our variables. |
|---|
| 11 | |
|---|
| 12 | NANOTOP_SOURCE_URL=http://www.zelow.no/floppyfw/download/hosted_source_packages/ |
|---|
| 13 | NANOTOP_SOURCE=nanotop-2.1.1.tgz |
|---|
| 14 | NANOTOP_DIR=$(BUILD_DIR)/nanotop-2.1.1 |
|---|
| 15 | NANOTOP_PKG_DIR=$(PACKAGES_DIR)/nanotop |
|---|
| 16 | |
|---|
| 17 | # Downloading the source. |
|---|
| 18 | |
|---|
| 19 | $(DL_DIR)/$(NANOTOP_SOURCE): |
|---|
| 20 | $(WGET) -P $(DL_DIR) $(NANOTOP_SOURCE_URL)$(NANOTOP_SOURCE) |
|---|
| 21 | |
|---|
| 22 | # Makes it possible to write 'make nanotop-source' from floppyfw |
|---|
| 23 | # directory to download source only. |
|---|
| 24 | |
|---|
| 25 | nanotop-source: $(DL_DIR)/$(NANOTOP_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 | # NANOTOP_DIR is because the files are packed in a folder within |
|---|
| 30 | # the tarball, thus ending up in the NANOTOP_DIR when unpacked. |
|---|
| 31 | |
|---|
| 32 | $(NANOTOP_DIR)/.unpacked: $(DL_DIR)/$(NANOTOP_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)/$(NANOTOP_SOURCE) |
|---|
| 37 | touch $(NANOTOP_DIR)/.unpacked |
|---|
| 38 | |
|---|
| 39 | # Makes the bin folder. |
|---|
| 40 | |
|---|
| 41 | $(NANOTOP_DIR)/.configured: $(NANOTOP_DIR)/.unpacked |
|---|
| 42 | if [ ! -d $(NANOTOP_DIR)/bin ]; then mkdir -p $(NANOTOP_DIR)/bin;fi |
|---|
| 43 | touch $(NANOTOP_DIR)/.configured |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | # Runs the make. Copies the finished binary to the package dir. |
|---|
| 47 | |
|---|
| 48 | $(NANOTOP_PKG_DIR)/bin/nanotop: $(NANOTOP_DIR)/.configured |
|---|
| 49 | $(MAKE) -C $(NANOTOP_DIR) |
|---|
| 50 | if [ ! -d $(NANOTOP_PKG_DIR)/bin ]; then mkdir -p $(NANOTOP_PKG_DIR)/bin;fi |
|---|
| 51 | cp $(NANOTOP_DIR)/bin/nanotop $(NANOTOP_PKG_DIR)/bin/nanotop |
|---|
| 52 | |
|---|
| 53 | # Makes the bz2 and ffw package files and places them under |
|---|
| 54 | # /floppyfw/packages. |
|---|
| 55 | |
|---|
| 56 | $(PACKAGES_DIR)/nanotop.bz2: $(NANOTOP_PKG_DIR)/bin/nanotop |
|---|
| 57 | (cd $(PACKAGES_DIR); sh mkpack nanotop) |
|---|
| 58 | |
|---|
| 59 | # Makes it possible to write 'make nanotop' from the floppyfw |
|---|
| 60 | # dir. |
|---|
| 61 | |
|---|
| 62 | nanotop: $(PACKAGES_DIR)/nanotop.bz2 |
|---|
| 63 | |
|---|
| 64 | # Makes it possible to write 'make nanotop-clean' from the |
|---|
| 65 | # floppyfw dir to remove everything related to nanotop. |
|---|
| 66 | |
|---|
| 67 | nanotop-clean: |
|---|
| 68 | $(RM) -r $(NANOTOP_DIR) |
|---|
| 69 | $(RM) -r $(NANOTOP_PKG_DIR) |
|---|
| 70 | $(RM) -r $(DL_DIR)/$(NANOTOP_SOURCE) |
|---|