aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-01 19:40:18 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-01 19:40:18 +0000
commit09a34e536896ecbe3e81618c7a45f9f1998bd8aa (patch)
tree74b13a3fdea9b99606d04316abb344c5197fc8f1
parent02f3b2e0c8ba8f8943efc745f1c1777383199278 (diff)
downloadbusybox-w32-09a34e536896ecbe3e81618c7a45f9f1998bd8aa.tar.gz
busybox-w32-09a34e536896ecbe3e81618c7a45f9f1998bd8aa.tar.bz2
busybox-w32-09a34e536896ecbe3e81618c7a45f9f1998bd8aa.zip
More updates for the Makefile to do BB_SRC_DIR. This is
primarily a patch from Larry Doolittle, but with updates from me to handle docs and link creation properly...
-rw-r--r--Makefile63
1 files changed, 48 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 8bd9c0e63..d43547e5f 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,8 @@ DODMALLOC = false
55DOLFS = false 55DOLFS = false
56 56
57# If you have a "pristine" source directory, point BB_SRC_DIR to it. 57# If you have a "pristine" source directory, point BB_SRC_DIR to it.
58# Experimental and incomplete; tell the mailing list
59# <busybox@opensource.lineo.com> if you do or don't like it so far.
58BB_SRC_DIR = . 60BB_SRC_DIR = .
59 61
60# If you are running a cross compiler, you may want to set this 62# If you are running a cross compiler, you may want to set this
@@ -80,8 +82,6 @@ OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&
80 82
81WARNINGS = -Wall 83WARNINGS = -Wall
82 84
83VPATH += :$(BB_SRC_DIR)
84
85ifeq ($(DOLFS),true) 85ifeq ($(DOLFS),true)
86 # For large file summit support 86 # For large file summit support
87 CFLAGS+=-D_FILE_OFFSET_BITS=64 87 CFLAGS+=-D_FILE_OFFSET_BITS=64
@@ -122,7 +122,23 @@ ifndef $(PREFIX)
122 PREFIX = `pwd`/_install 122 PREFIX = `pwd`/_install
123endif 123endif
124 124
125OBJECTS = $(shell cd $(BB_SRC_DIR); ./busybox.sh) busybox.o messages.o usage.o utility.o 125# Additional complications due to support for pristine source dir.
126# Config.h in the build directory should take precedence over the
127# copy in BB_SRC_DIR, both during the compilation phase and the
128# shell script that finds the list of object files.
129#
130# Work in progress by <ldoolitt@recycle.lbl.gov>.
131# If it gets in your way, set DISABLE_VPATH=yes
132ifeq ($(DISABLE_VPATH),yes)
133 CONFIG_H = Config.h
134else
135 VPATH = .:$(BB_SRC_DIR)
136 CONFIG_LIST = $(addsuffix /Config.h,$(subst :, ,$(VPATH)))
137 CONFIG_H = $(word 1,$(shell ls -f -1 $(CONFIG_LIST) 2>/dev/null))
138 CFLAGS += -I- $(patsubst %,-I%,$(subst :, ,$(VPATH)))
139endif
140
141OBJECTS = $(shell $(BB_SRC_DIR)/busybox.sh $(CONFIG_H) $(BB_SRC_DIR)) busybox.o messages.o usage.o utility.o
126CFLAGS += -DBB_VER='"$(VERSION)"' 142CFLAGS += -DBB_VER='"$(VERSION)"'
127CFLAGS += -DBB_BT='"$(BUILDTIME)"' 143CFLAGS += -DBB_BT='"$(BUILDTIME)"'
128ifdef BB_INIT_SCRIPT 144ifdef BB_INIT_SCRIPT
@@ -141,17 +157,23 @@ docs/BusyBox.txt: docs/busybox.pod
141 @echo 157 @echo
142 @echo BusyBox Documentation 158 @echo BusyBox Documentation
143 @echo 159 @echo
144 - pod2text docs/busybox.pod > docs/BusyBox.txt 160 - mkdir -p docs
161 - (cd $(BB_SRC_DIR); pod2text docs/busybox.pod) > docs/BusyBox.txt
145 162
146docs/BusyBox.1: docs/busybox.pod 163docs/BusyBox.1: docs/busybox.pod
147 - pod2man --center=BusyBox --release="version $(VERSION)" docs/busybox.pod > docs/BusyBox.1 164 - mkdir -p docs
165 - (cd $(BB_SRC_DIR); pod2man --center=BusyBox \
166 --release="version $(VERSION)" \
167 docs/busybox.pod ) > docs/BusyBox.1
148 168
149docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html 169docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
150 - rm -f docs/BusyBox.html 170 - rm -f docs/BusyBox.html
151 - ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html 171 - ln -s docs/busybox.lineo.com/BusyBox.html docs/BusyBox.html
152 172
153docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod 173docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
154 - pod2html --noindex docs/busybox.pod > docs/busybox.lineo.com/BusyBox.html 174 - mkdir -p docs/busybox.lineo.com
175 - (cd $(BB_SRC_DIR); pod2html --noindex docs/busybox.pod ) \
176 > docs/busybox.lineo.com/BusyBox.html
155 - rm -f pod2html* 177 - rm -f pod2html*
156 178
157 179
@@ -162,18 +184,23 @@ docs/busybox.txt: docs/busybox.sgml
162 @echo 184 @echo
163 @echo BusyBox Documentation 185 @echo BusyBox Documentation
164 @echo 186 @echo
165 (cd docs; sgmltools -b txt busybox.sgml) 187 - mkdir -p docs
188 (cd docs; sgmltools -b txt $(BB_SRC_DIR)/busybox.sgml)
166 189
167docs/busybox.dvi: docs/busybox.sgml 190docs/busybox.dvi: docs/busybox.sgml
168 (cd docs; sgmltools -b dvi busybox.sgml) 191 - mkdir -p docs
192 (cd docs; sgmltools -b dvi $(BB_SRC_DIR)/busybox.sgml)
169 193
170docs/busybox.ps: docs/busybox.sgml 194docs/busybox.ps: docs/busybox.sgml
171 (cd docs; sgmltools -b ps busybox.sgml) 195 - mkdir -p docs
196 (cd docs; sgmltools -b ps $(BB_SRC_DIR)/busybox.sgml)
172 197
173docs/busybox.pdf: docs/busybox.ps 198docs/busybox.pdf: docs/busybox.ps
174 (cd docs; ps2pdf busybox.ps) 199 - mkdir -p docs
200 (cd docs; ps2pdf $(BB_SRC_DIR)/busybox.ps)
175 201
176docs/busybox/busyboxdocumentation.html: docs/busybox.sgml 202docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
203 - mkdir -p docs
177 (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml) 204 (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
178 205
179 206
@@ -183,15 +210,15 @@ busybox: $(OBJECTS)
183 $(STRIP) 210 $(STRIP)
184 211
185busybox.links: Config.h 212busybox.links: Config.h
186 - ./busybox.mkll | sort >$@ 213 -(cd $(BB_SRC_DIR); ./busybox.mkll ) | sort >$@
187 214
188nfsmount.o cmdedit.o: %.o: %.h 215nfsmount.o cmdedit.o: %.o: %.h
189$(OBJECTS): %.o: %.c Config.h busybox.h Makefile 216$(OBJECTS): %.o: %.c Config.h busybox.h Makefile
190 217
191utility.o: loop.h 218utility.o: loop.h
192 219
193loop.h: 220loop.h: mk_loop_h.sh
194 @$(BB_SRC_DIR)/mk_loop_h.sh 221 @ sh $<
195 222
196test tests: 223test tests:
197 cd tests && $(MAKE) all 224 cd tests && $(MAKE) all
@@ -203,7 +230,7 @@ clean:
203 - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \ 230 - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
204 docs/busybox.pdf docs/busybox.lineo.com/busybox.html 231 docs/busybox.pdf docs/busybox.lineo.com/busybox.html
205 - rm -rf docs/busybox _install 232 - rm -rf docs/busybox _install
206 - rm -f busybox.links *~ *.o core 233 - rm -f busybox.links loop.h *~ *.o core
207 234
208distclean: clean 235distclean: clean
209 - rm -f busybox 236 - rm -f busybox
@@ -215,6 +242,12 @@ install: busybox busybox.links
215install-hardlinks: busybox busybox.links 242install-hardlinks: busybox busybox.links
216 ./install.sh $(PREFIX) --hardlinks 243 ./install.sh $(PREFIX) --hardlinks
217 244
245debug_pristine:
246 @ echo VPATH=\"$(VPATH)\"
247 @ echo CONFIG_LIST=\"$(CONFIG_LIST)\"
248 @ echo CONFIG_H=\"$(CONFIG_H)\"
249 @ echo OBJECTS=\"$(OBJECTS)\"
250
218dist release: distclean doc 251dist release: distclean doc
219 cd ..; \ 252 cd ..; \
220 rm -rf busybox-$(VERSION); \ 253 rm -rf busybox-$(VERSION); \