-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
148 lines (127 loc) · 4.92 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# 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