#-------------------------------------------------------------- # # We need to run "make menuconfig" to get users options # and then we run make to creat a distribution # #-------------------------------------------------------------- TOPDIR=./ CONFIG_CONFIG_IN = Config.in CONFIG_DEFCONFIG = .defconfig CONFIG = config PADS_CONFIG ?= menuselect.makeopts export ARCH=powerpc export CROSS_COMPILE=ppc_4xxFP- # Pull in the user's configuration file ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) -include $(TOPDIR)$(PADS_CONFIG) endif TAR_OPTIONS=$(subst ",, $(PADS_TAR_OPTIONS)) -xf #" ifeq ($(strip $(PADS_HAVE_DOT_CONFIG)),y) TARGETS:="" include package/Makefile.in ############################################################# # # You should probably leave this stuff alone unless you know # what you are doing. # ############################################################# all: world #In this section, we neeed .config include .config.cmd # We explicitly specify the build order of the first targets, # otherwise with 'include package/*/*.mk' they all end up in # alphabetical order. The alternative is to use explicit dependencies # to define the build order, for example have the asterisk target # depend on linux. TARGETS+=toolchain linux skeleton busybox # We also need the various per-package makefiles which we add to TARGETS include package/*/*.mk TARGETS_CLEAN:=$(patsubst %,%-clean, $(TARGETS)) TARGETS_SOURCE:=$(patsubst %,%-source, $(TARGETS)) TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) TARGETS_IMAGE:=$(patsubst %,%-image,$(TARGETS)) ############################################################################# # Custom Path ############################################################################# TOOLS_BIN=$(BASE_DIR)/toolchain/usr/bin PATH:= /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin PATH:= $(PATH):$(TOOLS_BIN) world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(PERSISTENT_STORAGE) $(TARGETS) .PHONY: all world clean dirclean distclean source $(TARGETS) \ $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_IMAGE) \ $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR) ############################################################# # # staging and target directories do NOT list these as # dependancies anywhere else # ############################################################# $(DL_DIR): @mkdir -p $(DL_DIR) $(BUILD_DIR): @mkdir -p $(BUILD_DIR) $(TOOL_BUILD_DIR): @mkdir -p $(TOOL_BUILD_DIR) $(STAGING_DIR): @mkdir -p $(STAGING_DIR)/lib @mkdir -p $(STAGING_DIR)/include @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TARGET_DIR): mkdir -p $(TARGET_DIR) $(PERSISTENT_STORAGE): mkdir -p $(PERSISTENT_STORAGE) .PHONY: image ROOTFS_SIZE=130000 image: $(TARGETS_IMAGE) genext2fs -U \ -d build_warp/root \ -b $(ROOTFS_SIZE) \ -i 2048 \ images/rootfs.img gzip -v9 images/rootfs.img mkimage -T ramdisk -C gzip -n 'PIKA Warp 1.0.0-170' \ -d images/rootfs.img.gz images/uRamdisk rm images/rootfs.img.gz mkfs.jffs2 -n -b -p -r build_warp/persistent -e 131072 -o images/image.jffs2 gcc -O3 -Wall utils/padit.c -o utils/padit if test -f images/cuImage.warp; \ then cp -f images/cuImage.warp images/cuImage.warp.tmp; \ utils/padit images/cuImage.warp.tmp images/cuImage.warp; \ fi cp -f images/uRamdisk images/uRamdisk.tmp utils/padit images/uRamdisk.tmp images/uRamdisk rm -f images/*.tmp ########################################################### # # Cleanup # ########################################################## clean: $(TARGETS_CLEAN) rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE_DIR) $(PERSISTENT_STORAGE) dirclean: $(TARGETS_DIRCLEAN) rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE_DIR) $(PERSISTENT_STORAGE) else # ifeq ($(strip $(PADS_HAVE_DOT_CONFIG)),y) ######################################################### # # Configuration # ######################################################### all: menuconfig endif # ifeq ($(strip $(PADS_HAVE_DOT_CONFIG)),y) $(CONFIG)/conf: $(MAKE) -C $(CONFIG) conf -@if [ ! -f $(PADS_CONFIG) ] ; then \ cp $(CONFIG_DEFCONFIG) $(PADS_CONFIG); \ fi $(CONFIG)/mconf: $(MAKE) -C $(CONFIG) ncurses conf mconf -@if [ ! -f $(PADS_CONFIG) ] ; then \ cp $(CONFIG_DEFCONFIG) $(PADS_CONFIG); \ fi menuconfig: $(CONFIG)/mconf @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) oldconfig: $(CONFIG)/conf @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)