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