Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
149 lines (127 sloc) 4.92 KB
# Makefile for kernel booter
SRCROOT = $(CURDIR)
OBJROOT = $(SRCROOT)/obj
SYMROOT = $(SRCROOT)/sym
DSTROOT = $(SRCROOT)/dst
DOCROOT = $(SRCROOT)/doc
IMGSKELROOT = $(SRCROOT)/imgskel
CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot
PKG_BUILD_DIR = $(SYMROOT)/package
include Make.rules
THEME = default
VERSION = `cat ${SRCROOT}/version`
REVISION = `cat ${SRCROOT}/revision`
PRODUCT = Chameleon-$(VERSION)-r$(REVISION)
CDLABEL = ${PRODUCT}
ISOIMAGE = ${SYMROOT}/${CDLABEL}.iso
DISTFILE = ${SYMROOT}/${PRODUCT}
IMGROOT = $(SRCROOT)/sym/${PRODUCT}
DISTROOT= ./${PRODUCT}
EXCLUDE = --exclude=.svn --exclude=.DS_Store --exclude=sym --exclude=obj \
--exclude=package --exclude=archive --exclude=User_Guide_src --exclude=*.sh
#RC_CFLAGS = i386
ARCHLESS_RC_CFLAGS=`echo $(RC_CFLAGS) | sed 's/-arch [a-z0-9]*//g'`
GENERIC_SUBDIRS =
SUBDIRS = $(GENERIC_SUBDIRS) i386
DIST_SUBDIRS = $(SUBDIRS)
$(SRCROOT)/revision:
@svnversion -n | tr -d [:alpha:] > $(SRCROOT)/revision
#
# Currently builds for i386
#
config rebuild_config:
@make -C $(SRCROOT)/i386/config $@
all: $(SYMROOT) $(OBJROOT) $(CONFIG_HEADERS) $(HEADER_VERSION) $(SRCROOT)/revision
@$(MAKE) all-recursive
dist image: all
@# To force the read of auto.conf (generated by 'all' target)
@make $@-local
dist-local image-local:
@echo "================= Distrib ================="
@echo "\t[RM] ${IMGROOT}"
@rm -rf ${IMGROOT}
@echo "\t[MKDIR] ${IMGROOT}/usr/standalone/i386"
@mkdir -p ${IMGROOT}/usr/standalone/i386
@echo "\t[MKDIR] ${IMGROOT}/Extra/modules"
@mkdir -p ${IMGROOT}/Extra/modules
@echo "\t[MKDIR] ${IMGROOT}/Extra/Themes/Default"
@mkdir -p ${IMGROOT}/Extra/Themes/Default
@echo "\t[MKDIR] ${IMGROOT}/usr/bin"
@mkdir -p ${IMGROOT}/usr/bin
@if [ -e "$(IMGSKELROOT)" ]; then \
@echo "\t[CP] ${IMGROOTSKEL} ${IMGROOT}" \
@cp -R -f "${IMGSKELROOT}"/* "${IMGROOT}"; \
fi;
@cp -f ${SYMROOT}/i386/cdboot ${CDBOOT}
@cp -f ${SYMROOT}/i386/modules/* ${IMGROOT}/Extra/modules
@cp -f ${SRCROOT}/artwork/themes/default/* ${IMGROOT}/Extra/Themes/Default
@cp -f ${SYMROOT}/i386/boot ${IMGROOT}/usr/standalone/i386
@cp -f ${SYMROOT}/i386/boot0 ${IMGROOT}/usr/standalone/i386
@cp -f ${SYMROOT}/i386/boot0hfs ${IMGROOT}/usr/standalone/i386
@cp -f ${SYMROOT}/i386/boot0md ${IMGROOT}/usr/standalone/i386
@cp -f ${SYMROOT}/i386/boot1h ${IMGROOT}/usr/standalone/i386
@cp -f ${SYMROOT}/i386/boot1f32 ${IMGROOT}/usr/standalone/i386
ifdef CONFIG_FDISK440
@cp -f ${SYMROOT}/i386/fdisk440 ${IMGROOT}/usr/bin
endif
ifdef CONFIG_BDMESG
@cp -f ${SYMROOT}/i386/bdmesg ${IMGROOT}/usr/bin
endif
ifdef CONFIG_KEYLAYOUT_MODULE
@cp -f ${SYMROOT}/i386/cham-mklayout ${IMGROOT}/usr/bin
@echo "\t[MKDIR] ${IMGROOT}/Extra/Keymaps"
@mkdir -p ${IMGROOT}/Extra/Keymaps
@echo "\t[CP] Keymaps ${IMGROOT}/Extra/Keymaps"
@cp -R -f "Keymaps"/* "${IMGROOT}/Extra/Keymaps/"
endif
@echo "\t[HDIUTIL] ${ISOIMAGE}"
@hdiutil makehybrid -iso -joliet -hfs -hfs-volume-name \
${CDLABEL} -eltorito-boot ${CDBOOT} -no-emul-boot -ov -o \
"${ISOIMAGE}" ${IMGROOT} -quiet
@echo "\t[GZ] ${DISTFILE}.tgz"
@rm -f ${DISTFILE}.tar.gz
@cd ${SYMROOT} && tar -cf ${DISTFILE}.tar ${DISTROOT}
@gzip --best ${DISTFILE}.tar
@mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz
clean-local:
@if [ -d "$(PKG_BUILD_DIR)" ];then echo "\t[RMDIR] $(PKG_BUILD_DIR)"; fi
@if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi
@if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi
@rm -rf "$(PKG_BUILD_DIR)" $(HEADER_VERSION) $(SRCROOT)/revision
AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \
$(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old
distclean-local:
@if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi
@if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi
@if [ -d "$(DSTROOT)" ];then echo "\t[RMDIR] $(DSTROOT)"; fi
@if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \
echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \
fi
@for cfg in $(AUTOCONF_FILES); do if [ -f "$${cfg}" ];then echo "\t[RM] $${cfg}"; fi; done
@rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \
$(SRCROOT)/i386/modules/module_includes \
$(AUTOCONF_FILES)
pkg installer: all
@echo "================= Building Package ================="
@${SRCROOT}/package/buildpkg.sh "$(SRCROOT)" "$(SYMROOT)" "$(PKG_BUILD_DIR)"
help:
@echo 'Configuration target:'
@echo ' config - Show configuration menu'
@echo
@echo 'Build targets:'
@echo ' all - Build all targets [DEFAULT]'
@echo ' dist - Build distribution tarball'
@echo ' pkg - Build installer package'
@echo
@echo 'Cleaning targets:'
@echo ' clean - Remove most generated files'
@echo ' distclean - Remove all generated files + config'
#@echo
# @echo 'Build options:'
# @echo 'make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
.PHONY: config
.PHONY: clean
.PHONY: image
.PHONY: pkg
.PHONY: installer
.PHONY: help
Jump to Line
Something went wrong with that request. Please try again.