forked from RevoGirl/RevoBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (83 loc) · 2.19 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
#
# Makefile for RevoBoot
#
export USE_APPLE_PB_SUPPORT = all
# CFLAGS = -O $(MORECPP) -arch i386 -g
DEFINES=
CONFIG = hd
LIBDIR = libsa
INC = -I. -I$(LIBDIR)
ifneq "" "$(wildcard /bin/mkdirs)"
MKDIRS = /bin/mkdirs
else
MKDIRS = /bin/mkdir -p
endif
AS = as
LD = ld
PAX = /bin/pax
OBJROOT = `pwd`/obj
SYMROOT = `pwd`/sym
DSTROOT = `pwd`/dst
SRCROOT = /tmp
#
# Export version number (picked up by i386/libsaio/Makefile)
#
export PRODUCT_VERSION_NUMBER = `cat ../../VERSION`
EXCLUDE = --exclude=.DS_Store --exclude=sym --exclude=obj --exclude=*.sh
ARCHLESS_RC_CFLAGS=`echo $(RC_CFLAGS) | sed 's/-arch [a-z0-9]*//g'`
VPATH = $(OBJROOT):$(SYMROOT)
GENERIC_SUBDIRS =
#
# Export target OS type (picked up by i386/libsaio/Makefile)
#
ifeq ($(MAKECMDGOALS), mountain-lion)
MAKE_TARGET_OS = 6;
else
ifeq ($(MAKECMDGOALS), lion)
MAKE_TARGET_OS = 2;
else
MAKE_TARGET_OS = 1;
endif
endif
export PRODUCT_OS_TARGET = `echo $(MAKE_TARGET_OS)`
lion: all
mountain-lion: all
all: $(SYMROOT) $(OBJROOT)
@if [ -z "$(RC_ARCHS)" ]; then \
RC_ARCHS="i386"; \
fi; \
SUBDIRS="$(GENERIC_SUBDIRS) $$RC_ARCHS"; \
for i in $$SUBDIRS; \
do \
if [ -d $$i ]; then \
echo ================= make $@ for $$i =================; \
( OBJROOT=$(OBJROOT)/$${i}; \
SYMROOT=$(SYMROOT)/$${i}; \
DSTROOT=$(DSTROOT); \
XCFLAGS=$(ARCHLESS_RC_CFLAGS); \
GENSUBDIRS="$(GENERIC_SUBDIRS)"; \
for x in $$GENSUBDIRS; \
do \
if [ "$$x" == "$$i" ]; then \
XCFLAGS="$(RC_CFLAGS)"; \
break; \
fi \
done; \
echo "$$OBJROOT $$SYMROOT $$DSTROOT"; \
cd $$i; ${MAKE} \
"OBJROOT=$$OBJROOT" \
"SYMROOT=$$SYMROOT" \
"DSTROOT=$$DSTROOT" \
"SRCROOT=$$SRCROOT" \
"RC_ARCHS=$$RC_ARCHS" \
"TARGET=$$i" \
"RC_CFLAGS=$$XCFLAGS" $@ \
) || exit $$?; \
else \
echo "========= Nothing to build for $$i ========="; \
fi; \
done
clean:
rm -rf sym obj dst out.log
$(SYMROOT) $(OBJROOT) $(DSTROOT):
@$(MKDIRS) $@