#-------------------------------------------------------------- # # 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 # Pull in the user's configuration file ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) -include $(TOPDIR).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 uBoot # 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=80000 image: $(TARGETS_IMAGE) bin/genext2fs -U \ -d build_warp/root \ -b $(ROOTFS_SIZE) \ -i 1024 \ images/rootfs.img gzip -v9 images/rootfs.img bin/mkimage -T ramdisk -C gzip -n 'PIKA Warp' \ -d images/rootfs.img.gz images/uRamdisk rm images/rootfs.img.gz mkfs.jffs2 -b -p -r build_warp/jffs -e 65536 -o images/image.jffs2 ########################################################### # # 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 .config ] ; then \ cp $(CONFIG_DEFCONFIG) .config; \ fi $(CONFIG)/mconf: $(MAKE) -C $(CONFIG) ncurses conf mconf -@if [ ! -f .config ] ; then \ cp $(CONFIG_DEFCONFIG) .config; \ fi menuconfig: $(CONFIG)/mconf @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)