################################################################# # 2007-01-14 # This is a makefile for compiling nanotop in the floppyFW # dev-kit. # # Kai Ove Gran # kaiove@humla.no ################################################################# # Setting our variables. NANOTOP_SOURCE_URL=http://www.zelow.no/floppyfw/download/hosted_source_packages/ NANOTOP_SOURCE=nanotop-2.1.1.tgz NANOTOP_DIR=$(BUILD_DIR)/nanotop-2.1.1 NANOTOP_PKG_DIR=$(PACKAGES_DIR)/nanotop # Downloading the source. $(DL_DIR)/$(NANOTOP_SOURCE): $(WGET) -P $(DL_DIR) $(NANOTOP_SOURCE_URL)$(NANOTOP_SOURCE) # Makes it possible to write 'make nanotop-source' from floppyfw # directory to download source only. nanotop-source: $(DL_DIR)/$(NANOTOP_SOURCE) # Unpacks the source from the download directory to the # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the # NANOTOP_DIR is because the files are packed in a folder within # the tarball, thus ending up in the NANOTOP_DIR when unpacked. $(NANOTOP_DIR)/.unpacked: $(DL_DIR)/$(NANOTOP_SOURCE) # PLEASE NOTE! This is a temporary patch which can be removed when this bug is fixed in the general makefile!! if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR);fi # ^-- This one that is ;) tar -C $(BUILD_DIR) -xvzf $(DL_DIR)/$(NANOTOP_SOURCE) touch $(NANOTOP_DIR)/.unpacked # Makes the bin folder. $(NANOTOP_DIR)/.configured: $(NANOTOP_DIR)/.unpacked if [ ! -d $(NANOTOP_DIR)/bin ]; then mkdir -p $(NANOTOP_DIR)/bin;fi touch $(NANOTOP_DIR)/.configured # Runs the make. Copies the finished binary to the package dir. $(NANOTOP_PKG_DIR)/bin/nanotop: $(NANOTOP_DIR)/.configured $(MAKE) -C $(NANOTOP_DIR) if [ ! -d $(NANOTOP_PKG_DIR)/bin ]; then mkdir -p $(NANOTOP_PKG_DIR)/bin;fi cp $(NANOTOP_DIR)/bin/nanotop $(NANOTOP_PKG_DIR)/bin/nanotop # Makes the bz2 and ffw package files and places them under # /floppyfw/packages. $(PACKAGES_DIR)/nanotop.bz2: $(NANOTOP_PKG_DIR)/bin/nanotop (cd $(PACKAGES_DIR); sh mkpack nanotop) # Makes it possible to write 'make nanotop' from the floppyfw # dir. nanotop: $(PACKAGES_DIR)/nanotop.bz2 # Makes it possible to write 'make nanotop-clean' from the # floppyfw dir to remove everything related to nanotop. nanotop-clean: $(RM) -r $(NANOTOP_DIR) $(RM) -r $(NANOTOP_PKG_DIR) $(RM) -r $(DL_DIR)/$(NANOTOP_SOURCE)