blob: 86fc9f6a6655138cc480946237649d008df33092 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001
2VERSION=0.29alpha1
3BUILDTIME=$(shell date "+%Y%m%d-%H%M")
Eric Andersen17d49ef1999-10-06 20:25:32 +00004DODEBUG=true
Eric Andersencc8ed391999-10-05 16:24:54 +00005
6#This will choke on a non-debian system
7ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
8
9
Eric Andersencc8ed391999-10-05 16:24:54 +000010# -D_GNU_SOURCE is needed because environ is used in init.c
Eric Andersen17d49ef1999-10-06 20:25:32 +000011ifeq ($(DODEBUG),true)
12 CFLAGS=-Wall -g -D_GNU_SOURCE
13 STRIP=
Eric Andersen8341a151999-10-08 17:14:14 +000014 LDFLAGS=
Eric Andersen17d49ef1999-10-06 20:25:32 +000015else
16 CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
Eric Andersen8341a151999-10-08 17:14:14 +000017 LDFLAGS= -s
Eric Andersen17d49ef1999-10-06 20:25:32 +000018 STRIP= strip --remove-section=.note --remove-section=.comment busybox
19endif
20
21ifndef $(prefix)
22 prefix=`pwd`
23endif
24BINDIR=$(prefix)
25
Eric Andersencc8ed391999-10-05 16:24:54 +000026LIBRARIES=-lc
Eric Andersen596e5461999-10-07 08:30:23 +000027OBJECTS=$(shell ./busybox.sh)
Eric Andersencc8ed391999-10-05 16:24:54 +000028CFLAGS+= -DBB_VER='"$(VERSION)"'
29CFLAGS+= -DBB_BT='"$(BUILDTIME)"'
30
Eric Andersen17d49ef1999-10-06 20:25:32 +000031all: busybox links
Eric Andersencc8ed391999-10-05 16:24:54 +000032
33busybox: $(OBJECTS)
Eric Andersen8341a151999-10-08 17:14:14 +000034 $(CC) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES)
Eric Andersen17d49ef1999-10-06 20:25:32 +000035 $(STRIP)
Eric Andersencc8ed391999-10-05 16:24:54 +000036
37links:
38 - ./busybox.mkll | sort >busybox.links
39
40clean:
41 - rm -f busybox busybox.links *~ *.o
42
43distclean: clean
44 - rm -f busybox
45
46force:
Eric Andersen2b69c401999-10-05 22:58:32 +000047
Eric Andersen9d3aba71999-10-06 09:04:55 +000048$(OBJECTS): busybox.def.h internal.h Makefile
Eric Andersen17d49ef1999-10-06 20:25:32 +000049
50install: busybox
51 install.sh $(BINDIR)
52