blob: 31fee8d1e31321b5d3de248eba6bcdebd5ee4df6 [file] [log] [blame]
Denis Vlasenko7d219aa2006-10-05 10:17:08 +00001# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
Denis Vlasenkod62fd842007-10-07 20:46:34 +00007obj-y :=
8obj-y += applets.o
Denis Vlasenko52b5eba2006-10-19 22:11:06 +00009
Denis Vlasenko432d69c2007-06-14 21:41:15 +000010hostprogs-y:=
Denys Vlasenkoacabf8f2009-10-02 01:10:32 +020011hostprogs-y += usage usage_pod applet_tables
Denis Vlasenko432d69c2007-06-14 21:41:15 +000012
Denis Vlasenkod62fd842007-10-07 20:46:34 +000013always:= $(hostprogs-y)
Denis Vlasenko432d69c2007-06-14 21:41:15 +000014
15# Generated files need additional love
Denis Vlasenkob5605772006-10-19 22:12:47 +000016
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000017# This trick decreases amount of rebuilds
18# if tree is merely renamed/copied
Denis Vlasenkof66fe9a2009-04-19 14:12:50 +000019ifeq ($(srctree),$(objtree))
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000020srctree_slash =
21else
22srctree_slash = $(srctree)/
23endif
24
Denys Vlasenkoacabf8f2009-10-02 01:10:32 +020025HOSTCFLAGS_usage.o = -I$(srctree_slash)include -Iinclude
26HOSTCFLAGS_usage_pod.o = -I$(srctree_slash)include -Iinclude
Denis Vlasenko432d69c2007-06-14 21:41:15 +000027
Denis Vlasenko745cd172007-11-29 03:31:20 +000028applets/applets.o: include/usage_compressed.h include/applet_tables.h
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000029
Denys Vlasenko6c5bf0d2010-06-06 00:53:45 +020030applets/applet_tables: .config include/applets.h
31applets/usage: .config include/applets.h
32applets/usage_pod: .config include/applet_tables.h include/applets.h
Denis Vlasenko745cd172007-11-29 03:31:20 +000033
34quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000035 cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000036
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000037include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compressed
Mike Frysingere5c09532007-01-02 05:42:35 +000038 $(call cmd,gen_usage_compressed)
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000039
Denis Vlasenko745cd172007-11-29 03:31:20 +000040quiet_cmd_gen_applet_tables = GEN include/applet_tables.h
Denys Vlasenko1fcbff22010-06-26 02:40:08 +020041 cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h
Denis Vlasenko745cd172007-11-29 03:31:20 +000042
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000043include/applet_tables.h: applets/applet_tables
Denis Vlasenko745cd172007-11-29 03:31:20 +000044 $(call cmd,gen_applet_tables)