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