blob: 88e98167a228087f5a642790efa425594e84180b [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
Denys Vlasenkob24c1132009-11-24 22:23:21 +010015# fixdep is needed to compile other host programs
16$(addprefix $(obj)/,$(always)): $(objtree)/scripts/basic/fixdep
17
Denis Vlasenko432d69c2007-06-14 21:41:15 +000018# Generated files need additional love
Denis Vlasenkob5605772006-10-19 22:12:47 +000019
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000020# This trick decreases amount of rebuilds
21# if tree is merely renamed/copied
Denis Vlasenkof66fe9a2009-04-19 14:12:50 +000022ifeq ($(srctree),$(objtree))
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000023srctree_slash =
24else
25srctree_slash = $(srctree)/
26endif
27
Denys Vlasenkoacabf8f2009-10-02 01:10:32 +020028HOSTCFLAGS_usage.o = -I$(srctree_slash)include -Iinclude
29HOSTCFLAGS_usage_pod.o = -I$(srctree_slash)include -Iinclude
Denis Vlasenko432d69c2007-06-14 21:41:15 +000030
Denis Vlasenko745cd172007-11-29 03:31:20 +000031applets/applets.o: include/usage_compressed.h include/applet_tables.h
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000032
Denys Vlasenko149a32a2009-10-22 12:12:17 +020033applets/applet_tables: .config $(srctree_slash)include/applets.h
34applets/usage: .config $(srctree_slash)include/applets.h
35applets/usage_pod: .config include/applet_tables.h $(srctree_slash)include/applets.h
Denis Vlasenko745cd172007-11-29 03:31:20 +000036
37quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000038 cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000039
Denis Vlasenkoa29c9352009-04-19 12:15:51 +000040include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compressed
Mike Frysingere5c09532007-01-02 05:42:35 +000041 $(call cmd,gen_usage_compressed)
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000042
Denis Vlasenko745cd172007-11-29 03:31:20 +000043quiet_cmd_gen_applet_tables = GEN include/applet_tables.h
44 cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h
45
Denis Vlasenko1aa7e472007-11-28 06:49:03 +000046include/applet_tables.h: applets/applet_tables
Denis Vlasenko745cd172007-11-29 03:31:20 +000047 $(call cmd,gen_applet_tables)