-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
182 lines (130 loc) · 4.08 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
####
# Pixil Makefile
# Copyright 2002, Century Software
#
# Written by: Jordan Crouse
# Released under the GPL (see LICENSE.GPL) for details
####
-include config
# Bring in the configuration file
BASE_DIR = ${shell pwd}
STAGE_DIR = $(BASE_DIR)/build
INCLUDE_DIR = $(BASE_DIR)/include
TOOL_DIR = $(BASE_DIR)/scripts/tools
IMAGES_DIR = $(BASE_DIR)/data/images
MCONFIG_DIR = $(BASE_DIR)/scripts/config
SYSDEP_DIR = $(BASE_DIR)/scripts/sysdep
# The base directory for installing
ROOT_DIR = $(strip $(subst ",, $(INSTALL_PREFIX)))
# The basic PDA install dir
ifdef CONFIG_PLATFORM_X86DEMO
INSTALL_DIR = $(ROOT_DIR)/pda
else
INSTALL_DIR=$(ROOT_DIR)
endif
MAKEFILES = $(BASE_DIR)/config
# The filenames for the PAR database files
PAR_CONFIG=$(INSTALL_DIR)/share/par/defaults.xml
PAR_DB=$(INSTALL_DIR)/share/par/pixil.db
# The cross compiler
TARGET_CROSS=$(subst ",, $(strip $(CROSS_COMPILER_PREFIX)))
# The system building the kernel (we're going to assume)
# Intel until somebody proves us wrong
BUILD_SYS=i386-linux
ifeq ($(CROSS_COMPILE),y)
ifeq ($(CONFIG_TARGET_ARM),y)
SYS=arm-linux
endif
ifeq ($(CONFIG_TARGET_I386_UCLIBC),y)
SYS=i386-uclibc-linux
endif
else
SYS=$(BUILD_SYS)
endif
export TARGET_CROSS BASE_DIR STAGE_DIR INCLUDE_DIR PAR_DB PAR_CONFIG
export TOOL_DIR INSTALL_DIR ROOT_DIR SYS BUILD_SYS
# Set up the list of directories based on the configuration
ifdef SUBDIRS
DIRS-y=$(SUBDIRS)
else
DIRS-y=libs sys apps packages
DIRS-$(CONFIG_PIXILDT)+=pixilDT
endif
subdir-build = $(patsubst %,_subdir_%,$(DIRS-y))
subdir-clean = $(patsubst %,_clean_%,$(DIRS-y))
subdir-install = $(patsubst %,_install_%,$(DIRS-y))
# This avoids stripping the debugging information when we choose debugging
STRIP_TARGET=
ifneq ($(CONFIG_DEBUG),y)
STRIP_TARGET=dostrip
endif
##### Toplevel targets #####
all: local-build
install: local-install
clean: local-clean
distclean: local-clean packages-clean
@ rm -rf config
##### Local targets #####
local-build: $(STAGE_DIR) $(INCLUDE_DIR)/pixil_config.h $(subdir-build) platform-build
local-install: $(INSTALL_DIR) $(subdir-install) $(STRIP_TARGET) platform-install
@ mkdir -p $(INSTALL_DIR)/share/images
@ cp -r $(IMAGES_DIR)/* $(INSTALL_DIR)/share/images
local-clean: $(subdir-clean) platform-clean
@ rm -rf $(STAGE_DIR) $(INCLUDE_DIR)/pixil_config.h
@ make -C scripts/config/ clean
dostrip:
@ echo "Stripping binaries..."
@ for fo in `find $(INSTALL_DIR) -type f -perm +111`; do \
if file $$fo | grep "ELF" > /dev/null; then \
$(TARGET_CROSS)strip $$fo; \
fi; \
done
$(subdir-build): dummy
@ $(MAKE) -C $(patsubst _subdir_%,%,$@)
$(subdir-clean): dummy
@ $(MAKE) -C $(patsubst _clean_%,%,$@) clean
$(subdir-install): dummy
@ $(MAKE) -C $(patsubst _install_%,%,$@) install
platform-build:
@ make -C scripts/platforms/
platform-clean:
@ make -C scripts/platforms/ clean
platform-install:
@ make -C scripts/platforms/ install
packages:
@ make -C packages
packages-clean:
@ make -C packages packages-clean
$(STAGE_DIR):
@ mkdir -p $(STAGE_DIR)/lib
$(INSTALL_DIR):
@ mkdir -p $(INSTALL_DIR)/lib
@ mkdir -p $(INSTALL_DIR)/bin
@ mkdir -p $(INSTALL_DIR)/share
@ mkdir -p $(INSTALL_DIR)/share/data
$(INCLUDE_DIR)/pixil_config.h: $(BASE_DIR)/config
@ perl $(TOOL_DIR)/config.pl $(BASE_DIR)/config \
> $(INCLUDE_DIR)/pixil_config.h
# configuration
# ------------------------------
$(MCONFIG_DIR)/conf:
make -C $(MCONFIG_DIR) conf
$(MCONFIG_DIR)/mconf:
make -C $(MCONFIG_DIR) conf mconf
menuconfig: $(BASE_DIR)/config $(MCONFIG_DIR)/mconf
@$(MCONFIG_DIR)/mconf $(SYSDEP_DIR)/Config.in
textconfig: $(BASE_DIR)/config $(MCONFIG_DIR)/conf
@$(MCONFIG_DIR)/conf $(SYSDEP_DIR)/Config.in
oldconfig: $(MCONFIG_DIR)/conf
@$(MCONFIG_DIR)/conf -o $(SYSDEP_DIR)/Config.in
defconfig: $(BASE_DIR)/config
$(BASE_DIR)/config:
@ cp $(SYSDEP_DIR)/defconfig $(BASE_DIR)/config
defconfig_ipaq:
@ cp $(SYSDEP_DIR)/defconfig.ipaq $(BASE_DIR)/config
defconfig_zaurus:
@ cp $(SYSDEP_DIR)/defconfig.zaurus $(BASE_DIR)/config
defconfig_tuxscreen:
@ cp $(SYSDEP_DIR)/defconfig.tuxscreen $(BASE_DIR)/config
dummy:
.PHONY: menuconfig textconfig oldconfig defconfig dummy packages