Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 1 | |
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 2 | PROG=busybox |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 3 | VERSION=0.29alpha1 |
4 | BUILDTIME=$(shell date "+%Y%m%d-%H%M") | ||||
Eric Andersen | 21943ce | 1999-10-13 18:04:51 +0000 | [diff] [blame] | 5 | |
6 | # Comment out the following to make a debuggable build | ||||
7 | # Leave this off for production use. | ||||
Eric Andersen | 3c16382 | 1999-10-14 22:16:57 +0000 | [diff] [blame] | 8 | #DODEBUG=true |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 9 | |
10 | #This will choke on a non-debian system | ||||
11 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` | ||||
12 | |||||
13 | |||||
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 14 | # -D_GNU_SOURCE is needed because environ is used in init.c |
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 15 | ifeq ($(DODEBUG),true) |
16 | CFLAGS=-Wall -g -D_GNU_SOURCE | ||||
17 | STRIP= | ||||
Eric Andersen | 8341a15 | 1999-10-08 17:14:14 +0000 | [diff] [blame] | 18 | LDFLAGS= |
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 19 | else |
Eric Andersen | cb6e256 | 1999-10-16 15:48:40 +0000 | [diff] [blame] | 20 | CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE |
Eric Andersen | 8341a15 | 1999-10-08 17:14:14 +0000 | [diff] [blame] | 21 | LDFLAGS= -s |
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 22 | STRIP= strip --remove-section=.note --remove-section=.comment |
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 23 | endif |
24 | |||||
25 | ifndef $(prefix) | ||||
26 | prefix=`pwd` | ||||
27 | endif | ||||
28 | BINDIR=$(prefix) | ||||
29 | |||||
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 30 | LIBRARIES=-lc |
Eric Andersen | 596e546 | 1999-10-07 08:30:23 +0000 | [diff] [blame] | 31 | OBJECTS=$(shell ./busybox.sh) |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 32 | CFLAGS+= -DBB_VER='"$(VERSION)"' |
33 | CFLAGS+= -DBB_BT='"$(BUILDTIME)"' | ||||
34 | |||||
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 35 | all: busybox links |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 36 | |
37 | busybox: $(OBJECTS) | ||||
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 38 | $(CC) $(LDFLAGS) -o $(PROG) $(OBJECTS) $(LIBRARIES) |
39 | $(STRIP) $(PROG) | ||||
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 40 | |
41 | links: | ||||
42 | - ./busybox.mkll | sort >busybox.links | ||||
43 | |||||
44 | clean: | ||||
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 45 | - rm -f $(PROG) busybox.links *~ *.o core |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 46 | |
47 | distclean: clean | ||||
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 48 | - rm -f $(PROG) |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 49 | |
50 | force: | ||||
Eric Andersen | 2b69c40 | 1999-10-05 22:58:32 +0000 | [diff] [blame] | 51 | |
Eric Andersen | 9d3aba7 | 1999-10-06 09:04:55 +0000 | [diff] [blame] | 52 | $(OBJECTS): busybox.def.h internal.h Makefile |
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 53 | |
Eric Andersen | f8d650c | 1999-10-19 23:27:54 +0000 | [diff] [blame^] | 54 | install: $(PROG) |
Eric Andersen | 17d49ef | 1999-10-06 20:25:32 +0000 | [diff] [blame] | 55 | install.sh $(BINDIR) |
56 |