blob: ee393088065bc3329599bac008d64cda36d3536e [file] [log] [blame]
Eric Andersencc8ed391999-10-05 16:24:54 +00001
Eric Andersenf8d650c1999-10-19 23:27:54 +00002PROG=busybox
Eric Andersencc8ed391999-10-05 16:24:54 +00003VERSION=0.29alpha1
4BUILDTIME=$(shell date "+%Y%m%d-%H%M")
Eric Andersen21943ce1999-10-13 18:04:51 +00005
6# Comment out the following to make a debuggable build
7# Leave this off for production use.
Eric Andersend23f9ba1999-10-20 19:18:15 +00008#DODEBUG=true
Eric Andersencc8ed391999-10-05 16:24:54 +00009
10#This will choke on a non-debian system
11ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
12
13
Eric Andersencc8ed391999-10-05 16:24:54 +000014# -D_GNU_SOURCE is needed because environ is used in init.c
Eric Andersen17d49ef1999-10-06 20:25:32 +000015ifeq ($(DODEBUG),true)
16 CFLAGS=-Wall -g -D_GNU_SOURCE
17 STRIP=
Eric Andersen8341a151999-10-08 17:14:14 +000018 LDFLAGS=
Eric Andersen17d49ef1999-10-06 20:25:32 +000019else
Eric Andersencb6e2561999-10-16 15:48:40 +000020 CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
Eric Andersen8341a151999-10-08 17:14:14 +000021 LDFLAGS= -s
Eric Andersence8f3b91999-10-20 07:03:36 +000022 STRIP= strip --remove-section=.note --remove-section=.comment $(PROG)
Eric Andersen17d49ef1999-10-06 20:25:32 +000023endif
24
25ifndef $(prefix)
26 prefix=`pwd`
27endif
28BINDIR=$(prefix)
29
Eric Andersencc8ed391999-10-05 16:24:54 +000030LIBRARIES=-lc
Eric Andersen596e5461999-10-07 08:30:23 +000031OBJECTS=$(shell ./busybox.sh)
Eric Andersencc8ed391999-10-05 16:24:54 +000032CFLAGS+= -DBB_VER='"$(VERSION)"'
33CFLAGS+= -DBB_BT='"$(BUILDTIME)"'
34
Eric Andersen17d49ef1999-10-06 20:25:32 +000035all: busybox links
Eric Andersencc8ed391999-10-05 16:24:54 +000036
37busybox: $(OBJECTS)
Eric Andersenf8d650c1999-10-19 23:27:54 +000038 $(CC) $(LDFLAGS) -o $(PROG) $(OBJECTS) $(LIBRARIES)
Eric Andersence8f3b91999-10-20 07:03:36 +000039 $(STRIP)
Eric Andersencc8ed391999-10-05 16:24:54 +000040
41links:
42 - ./busybox.mkll | sort >busybox.links
43
44clean:
Eric Andersenf8d650c1999-10-19 23:27:54 +000045 - rm -f $(PROG) busybox.links *~ *.o core
Eric Andersencc8ed391999-10-05 16:24:54 +000046
47distclean: clean
Eric Andersenf8d650c1999-10-19 23:27:54 +000048 - rm -f $(PROG)
Eric Andersencc8ed391999-10-05 16:24:54 +000049
50force:
Eric Andersen2b69c401999-10-05 22:58:32 +000051
Eric Andersen9d3aba71999-10-06 09:04:55 +000052$(OBJECTS): busybox.def.h internal.h Makefile
Eric Andersen17d49ef1999-10-06 20:25:32 +000053
Eric Andersenf8d650c1999-10-19 23:27:54 +000054install: $(PROG)
Eric Andersen17d49ef1999-10-06 20:25:32 +000055 install.sh $(BINDIR)
56