diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-12-01 19:40:18 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-12-01 19:40:18 +0000 |
commit | 09a34e536896ecbe3e81618c7a45f9f1998bd8aa (patch) | |
tree | 74b13a3fdea9b99606d04316abb344c5197fc8f1 | |
parent | 02f3b2e0c8ba8f8943efc745f1c1777383199278 (diff) | |
download | busybox-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-- | Makefile | 63 |
1 files changed, 48 insertions, 15 deletions
@@ -55,6 +55,8 @@ DODMALLOC = false | |||
55 | DOLFS = false | 55 | DOLFS = 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. | ||
58 | BB_SRC_DIR = . | 60 | BB_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 | ||
81 | WARNINGS = -Wall | 83 | WARNINGS = -Wall |
82 | 84 | ||
83 | VPATH += :$(BB_SRC_DIR) | ||
84 | |||
85 | ifeq ($(DOLFS),true) | 85 | ifeq ($(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 |
123 | endif | 123 | endif |
124 | 124 | ||
125 | OBJECTS = $(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 | ||
132 | ifeq ($(DISABLE_VPATH),yes) | ||
133 | CONFIG_H = Config.h | ||
134 | else | ||
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))) | ||
139 | endif | ||
140 | |||
141 | OBJECTS = $(shell $(BB_SRC_DIR)/busybox.sh $(CONFIG_H) $(BB_SRC_DIR)) busybox.o messages.o usage.o utility.o | ||
126 | CFLAGS += -DBB_VER='"$(VERSION)"' | 142 | CFLAGS += -DBB_VER='"$(VERSION)"' |
127 | CFLAGS += -DBB_BT='"$(BUILDTIME)"' | 143 | CFLAGS += -DBB_BT='"$(BUILDTIME)"' |
128 | ifdef BB_INIT_SCRIPT | 144 | ifdef 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 | ||
146 | docs/BusyBox.1: docs/busybox.pod | 163 | docs/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 | ||
149 | docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html | 169 | docs/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 | ||
153 | docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod | 173 | docs/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 | ||
167 | docs/busybox.dvi: docs/busybox.sgml | 190 | docs/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 | ||
170 | docs/busybox.ps: docs/busybox.sgml | 194 | docs/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 | ||
173 | docs/busybox.pdf: docs/busybox.ps | 198 | docs/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 | ||
176 | docs/busybox/busyboxdocumentation.html: docs/busybox.sgml | 202 | docs/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 | ||
185 | busybox.links: Config.h | 212 | busybox.links: Config.h |
186 | - ./busybox.mkll | sort >$@ | 213 | -(cd $(BB_SRC_DIR); ./busybox.mkll ) | sort >$@ |
187 | 214 | ||
188 | nfsmount.o cmdedit.o: %.o: %.h | 215 | nfsmount.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 | ||
191 | utility.o: loop.h | 218 | utility.o: loop.h |
192 | 219 | ||
193 | loop.h: | 220 | loop.h: mk_loop_h.sh |
194 | @$(BB_SRC_DIR)/mk_loop_h.sh | 221 | @ sh $< |
195 | 222 | ||
196 | test tests: | 223 | test 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 | ||
208 | distclean: clean | 235 | distclean: clean |
209 | - rm -f busybox | 236 | - rm -f busybox |
@@ -215,6 +242,12 @@ install: busybox busybox.links | |||
215 | install-hardlinks: busybox busybox.links | 242 | install-hardlinks: busybox busybox.links |
216 | ./install.sh $(PREFIX) --hardlinks | 243 | ./install.sh $(PREFIX) --hardlinks |
217 | 244 | ||
245 | debug_pristine: | ||
246 | @ echo VPATH=\"$(VPATH)\" | ||
247 | @ echo CONFIG_LIST=\"$(CONFIG_LIST)\" | ||
248 | @ echo CONFIG_H=\"$(CONFIG_H)\" | ||
249 | @ echo OBJECTS=\"$(OBJECTS)\" | ||
250 | |||
218 | dist release: distclean doc | 251 | dist release: distclean doc |
219 | cd ..; \ | 252 | cd ..; \ |
220 | rm -rf busybox-$(VERSION); \ | 253 | rm -rf busybox-$(VERSION); \ |