Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 1 | # This is completely unsupported. |
| 2 | # Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate |
| 3 | # the changes back |
| 4 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
| 5 | objtree := $(CURDIR) |
| 6 | src := $(srctree) |
| 7 | obj := $(objtree) |
| 8 | |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 9 | # Look for make include files relative to root of kernel src |
| 10 | MAKEFLAGS += --include-dir=$(srctree) |
| 11 | |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 12 | default: busybox |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 13 | |
| 14 | ifndef HOSTCC |
| 15 | HOSTCC = cc |
| 16 | endif |
| 17 | AS = $(CROSS_COMPILE)as |
| 18 | CC = $(CROSS_COMPILE)gcc |
| 19 | LD = $(CC) -nostdlib |
| 20 | CPP = $(CC) -E |
| 21 | AR = $(CROSS_COMPILE)ar |
| 22 | NM = $(CROSS_COMPILE)nm |
| 23 | STRIP = $(CROSS_COMPILE)strip |
| 24 | OBJCOPY = $(CROSS_COMPILE)objcopy |
| 25 | OBJDUMP = $(CROSS_COMPILE)objdump |
| 26 | |
| 27 | CFLAGS := $(CFLAGS) |
| 28 | CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 29 | |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 30 | include .config |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 31 | # We need some generic definitions |
| 32 | include $(srctree)/scripts/Kbuild.include |
| 33 | |
| 34 | include Makefile.flags |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 35 | ifdef CONFIG_FEATURE_COMPRESS_USAGE |
| 36 | usage_stuff = include/usage_compressed.h |
| 37 | endif |
| 38 | |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 39 | ifndef BB_VER |
| 40 | BB_VER:="" |
| 41 | endif |
| 42 | |
Bernhard Reutner-Fischer | eecd588 | 2008-04-11 12:42:23 +0000 | [diff] [blame^] | 43 | WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,) |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 44 | |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 45 | # pull in the config stuff |
Bernhard Reutner-Fischer | 64332bf | 2007-05-15 09:07:06 +0000 | [diff] [blame] | 46 | lib-all-y := applets/applets.o |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 47 | lib-y:= |
| 48 | include procps/Kbuild |
| 49 | lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y))) |
| 50 | lib-y:= |
| 51 | include networking/Kbuild |
| 52 | lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y))) |
| 53 | lib-y:= |
| 54 | include networking/udhcp/Kbuild |
| 55 | lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y))) |
| 56 | lib-y:= |
| 57 | include networking/libiproute/Kbuild |
| 58 | lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y))) |
| 59 | lib-y:= |
| 60 | include loginutils/Kbuild |
| 61 | lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y))) |
| 62 | lib-y:= |
| 63 | include archival/Kbuild |
| 64 | lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y))) |
| 65 | lib-y:= |
| 66 | include archival/libunarchive/Kbuild |
| 67 | lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y))) |
| 68 | lib-y:= |
| 69 | include applets/Kbuild |
| 70 | lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y))) |
| 71 | lib-y:= |
| 72 | include e2fsprogs/Kbuild |
| 73 | lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y))) |
| 74 | lib-y:= |
| 75 | #include e2fsprogs/old_e2fsprogs/Kbuild |
| 76 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y))) |
| 77 | #lib-y:= |
| 78 | #include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild |
| 79 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y))) |
| 80 | #lib-y:= |
| 81 | #include e2fsprogs/old_e2fsprogs/blkid/Kbuild |
| 82 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y))) |
| 83 | #lib-y:= |
| 84 | #include e2fsprogs/old_e2fsprogs/uuid/Kbuild |
| 85 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y))) |
| 86 | #lib-y:= |
| 87 | #include e2fsprogs/old_e2fsprogs/e2p/Kbuild |
| 88 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y))) |
| 89 | #lib-y:= |
| 90 | include debianutils/Kbuild |
| 91 | lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y))) |
| 92 | lib-y:= |
| 93 | include runit/Kbuild |
| 94 | lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y))) |
| 95 | lib-y:= |
| 96 | include modutils/Kbuild |
| 97 | lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y))) |
| 98 | lib-y:= |
| 99 | include miscutils/Kbuild |
| 100 | lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y))) |
| 101 | lib-y:= |
| 102 | include coreutils/libcoreutils/Kbuild |
| 103 | lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y))) |
| 104 | lib-y:= |
| 105 | include coreutils/Kbuild |
| 106 | lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y))) |
| 107 | lib-y:= |
| 108 | include sysklogd/Kbuild |
| 109 | lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y))) |
| 110 | lib-y:= |
| 111 | include shell/Kbuild |
| 112 | lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y))) |
| 113 | lib-y:= |
| 114 | include console-tools/Kbuild |
| 115 | lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y))) |
| 116 | lib-y:= |
| 117 | include findutils/Kbuild |
| 118 | lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y))) |
| 119 | lib-y:= |
| 120 | include util-linux/Kbuild |
| 121 | lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y))) |
| 122 | lib-y:= |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 123 | include util-linux/volume_id/Kbuild |
| 124 | lib-all-y += $(patsubst %,util-linux/volume_id/%,$(sort $(lib-y))) |
| 125 | lib-y:= |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 126 | include init/Kbuild |
| 127 | lib-all-y += $(patsubst %,init/%,$(sort $(lib-y))) |
| 128 | lib-y:= |
| 129 | include libpwdgrp/Kbuild |
| 130 | lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y))) |
| 131 | lib-y:= |
| 132 | include editors/Kbuild |
| 133 | lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y))) |
| 134 | lib-y:= |
Bernhard Reutner-Fischer | 119f87b | 2008-04-11 08:46:56 +0000 | [diff] [blame] | 135 | include printutils/Kbuild |
| 136 | lib-all-y += $(patsubst %,printutils/%,$(sort $(lib-y))) |
| 137 | lib-y:= |
Bernhard Reutner-Fischer | e11b4a4 | 2007-03-09 08:46:31 +0000 | [diff] [blame] | 138 | include selinux/Kbuild |
| 139 | lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y))) |
| 140 | lib-y:= |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 141 | include scripts/Kbuild |
| 142 | lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y))) |
| 143 | lib-y:= |
| 144 | include libbb/Kbuild |
| 145 | lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y))) |
| 146 | lib-y:= |
| 147 | |
Bernhard Reutner-Fischer | 1d690db | 2008-04-11 12:31:57 +0000 | [diff] [blame] | 148 | comma:=, |
Denis Vlasenko | 93b8263 | 2008-04-11 11:27:29 +0000 | [diff] [blame] | 149 | busybox: $(usage_stuff) include/applet_tables.h |
| 150 | $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) \ |
Bernhard Reutner-Fischer | 1d690db | 2008-04-11 12:31:57 +0000 | [diff] [blame] | 151 | $(patsubst %,-Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) \ |
Denis Vlasenko | 93b8263 | 2008-04-11 11:27:29 +0000 | [diff] [blame] | 152 | -DGCC_COMBINE=1 \ |
| 153 | --combine $(WHOLE_PROGRAM) \ |
Bernhard Reutner-Fischer | 493691a | 2007-02-02 16:11:24 +0000 | [diff] [blame] | 154 | -funit-at-a-time -Wno-error -std=gnu99 \ |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 155 | -o $(@)_unstripped $(lib-all-y:.o=.c) \ |
| 156 | -Wl,--start-group -lcrypt -lm -Wl,--end-group |
Bernhard Reutner-Fischer | 64332bf | 2007-05-15 09:07:06 +0000 | [diff] [blame] | 157 | cp -f $(@)_unstripped $@ |
| 158 | -$(STRIP) -s -R .note -R .comment -R .version $@ |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 159 | |
| 160 | applets/usage: |
Denis Vlasenko | 93b8263 | 2008-04-11 11:27:29 +0000 | [diff] [blame] | 161 | $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c |
| 162 | |
| 163 | applets/applet_tables: |
| 164 | $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/applet_tables applets/applet_tables.c |
| 165 | |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 166 | include/usage_compressed.h: $(srctree)/include/usage.h applets/usage |
| 167 | $(srctree)/applets/usage_compressed include/usage_compressed.h applets |
| 168 | |
Denis Vlasenko | 93b8263 | 2008-04-11 11:27:29 +0000 | [diff] [blame] | 169 | include/applet_tables.h: $(srctree)/include/applets.h |
| 170 | applets/applet_tables include/applet_tables.h |