blob: 4b05075f9abc5695920cac8c4bc7a12777f24190 [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001
2VERSION=0.29alpha1
3BUILDTIME=$(shell date "+%Y%m%d-%H%M")
Eric Andersen21943ce1999-10-13 18:04:51 +00004
5# Comment out the following to make a debuggable build
6# Leave this off for production use.
Eric Andersen3c163821999-10-14 22:16:57 +00007#DODEBUG=true
Eric Andersencc8ed391999-10-05 16:24:54 +00008
9#This will choke on a non-debian system
10ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
11
12
Eric Andersencc8ed391999-10-05 16:24:54 +000013# -D_GNU_SOURCE is needed because environ is used in init.c
Eric Andersen17d49ef1999-10-06 20:25:32 +000014ifeq ($(DODEBUG),true)
15 CFLAGS=-Wall -g -D_GNU_SOURCE
16 STRIP=
Eric Andersen8341a151999-10-08 17:14:14 +000017 LDFLAGS=
Eric Andersen17d49ef1999-10-06 20:25:32 +000018else
Eric Andersencb6e2561999-10-16 15:48:40 +000019 CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
Eric Andersen8341a151999-10-08 17:14:14 +000020 LDFLAGS= -s
Eric Andersen17d49ef1999-10-06 20:25:32 +000021 STRIP= strip --remove-section=.note --remove-section=.comment busybox
22endif
23
24ifndef $(prefix)
25 prefix=`pwd`
26endif
27BINDIR=$(prefix)
28
Eric Andersencc8ed391999-10-05 16:24:54 +000029LIBRARIES=-lc
Eric Andersen596e5461999-10-07 08:30:23 +000030OBJECTS=$(shell ./busybox.sh)
Eric Andersencc8ed391999-10-05 16:24:54 +000031CFLAGS+= -DBB_VER='"$(VERSION)"'
32CFLAGS+= -DBB_BT='"$(BUILDTIME)"'
33
Eric Andersen17d49ef1999-10-06 20:25:32 +000034all: busybox links
Eric Andersencc8ed391999-10-05 16:24:54 +000035
36busybox: $(OBJECTS)
Eric Andersen8341a151999-10-08 17:14:14 +000037 $(CC) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES)
Eric Andersen17d49ef1999-10-06 20:25:32 +000038 $(STRIP)
Eric Andersencc8ed391999-10-05 16:24:54 +000039
40links:
41 - ./busybox.mkll | sort >busybox.links
42
43clean:
Eric Andersen2c103011999-10-13 22:56:11 +000044 - rm -f busybox busybox.links *~ *.o core
Eric Andersencc8ed391999-10-05 16:24:54 +000045
46distclean: clean
47 - rm -f busybox
48
49force:
Eric Andersen2b69c401999-10-05 22:58:32 +000050
Eric Andersen9d3aba71999-10-06 09:04:55 +000051$(OBJECTS): busybox.def.h internal.h Makefile
Eric Andersen17d49ef1999-10-06 20:25:32 +000052
53install: busybox
54 install.sh $(BINDIR)
55