Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
| 3 | # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> |
| 4 | # |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 5 | # Licensed under GPLv2, see file LICENSE in this source tree. |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 6 | |
Denis Vlasenko | d62fd84 | 2007-10-07 20:46:34 +0000 | [diff] [blame] | 7 | obj-y := |
| 8 | obj-y += applets.o |
Denis Vlasenko | 52b5eba | 2006-10-19 22:11:06 +0000 | [diff] [blame] | 9 | |
Denis Vlasenko | 432d69c | 2007-06-14 21:41:15 +0000 | [diff] [blame] | 10 | hostprogs-y:= |
Denys Vlasenko | acabf8f | 2009-10-02 01:10:32 +0200 | [diff] [blame] | 11 | hostprogs-y += usage usage_pod applet_tables |
Denis Vlasenko | 432d69c | 2007-06-14 21:41:15 +0000 | [diff] [blame] | 12 | |
Denis Vlasenko | d62fd84 | 2007-10-07 20:46:34 +0000 | [diff] [blame] | 13 | always:= $(hostprogs-y) |
Denis Vlasenko | 432d69c | 2007-06-14 21:41:15 +0000 | [diff] [blame] | 14 | |
| 15 | # Generated files need additional love |
Denis Vlasenko | b560577 | 2006-10-19 22:12:47 +0000 | [diff] [blame] | 16 | |
Denis Vlasenko | a29c935 | 2009-04-19 12:15:51 +0000 | [diff] [blame] | 17 | # This trick decreases amount of rebuilds |
| 18 | # if tree is merely renamed/copied |
Denis Vlasenko | f66fe9a | 2009-04-19 14:12:50 +0000 | [diff] [blame] | 19 | ifeq ($(srctree),$(objtree)) |
Denis Vlasenko | a29c935 | 2009-04-19 12:15:51 +0000 | [diff] [blame] | 20 | srctree_slash = |
| 21 | else |
| 22 | srctree_slash = $(srctree)/ |
| 23 | endif |
| 24 | |
Denys Vlasenko | acabf8f | 2009-10-02 01:10:32 +0200 | [diff] [blame] | 25 | HOSTCFLAGS_usage.o = -I$(srctree_slash)include -Iinclude |
| 26 | HOSTCFLAGS_usage_pod.o = -I$(srctree_slash)include -Iinclude |
Denis Vlasenko | 432d69c | 2007-06-14 21:41:15 +0000 | [diff] [blame] | 27 | |
Denis Vlasenko | 745cd17 | 2007-11-29 03:31:20 +0000 | [diff] [blame] | 28 | applets/applets.o: include/usage_compressed.h include/applet_tables.h |
Denis Vlasenko | 1aa7e47 | 2007-11-28 06:49:03 +0000 | [diff] [blame] | 29 | |
Denys Vlasenko | 6c5bf0d | 2010-06-06 00:53:45 +0200 | [diff] [blame] | 30 | applets/applet_tables: .config include/applets.h |
| 31 | applets/usage: .config include/applets.h |
Denys Vlasenko | d8e61bb | 2016-08-21 22:00:20 +0200 | [diff] [blame^] | 32 | applets/usage_pod: .config include/applets.h include/applet_tables.h |
Denis Vlasenko | 745cd17 | 2007-11-29 03:31:20 +0000 | [diff] [blame] | 33 | |
| 34 | quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h |
Denis Vlasenko | a29c935 | 2009-04-19 12:15:51 +0000 | [diff] [blame] | 35 | cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets |
Denis Vlasenko | 1aa7e47 | 2007-11-28 06:49:03 +0000 | [diff] [blame] | 36 | |
Denis Vlasenko | a29c935 | 2009-04-19 12:15:51 +0000 | [diff] [blame] | 37 | include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compressed |
Mike Frysinger | e5c0953 | 2007-01-02 05:42:35 +0000 | [diff] [blame] | 38 | $(call cmd,gen_usage_compressed) |
Denis Vlasenko | 1aa7e47 | 2007-11-28 06:49:03 +0000 | [diff] [blame] | 39 | |
Denys Vlasenko | d8e61bb | 2016-08-21 22:00:20 +0200 | [diff] [blame^] | 40 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h include/NUM_APPLETS.h |
Denys Vlasenko | 1fcbff2 | 2010-06-26 02:40:08 +0200 | [diff] [blame] | 41 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h |
Denis Vlasenko | 745cd17 | 2007-11-29 03:31:20 +0000 | [diff] [blame] | 42 | |
Denys Vlasenko | d8e61bb | 2016-08-21 22:00:20 +0200 | [diff] [blame^] | 43 | include/NUM_APPLETS.h: applets/applet_tables |
| 44 | $(call cmd,gen_applet_tables) |
| 45 | |
| 46 | # In fact, include/applet_tables.h depends only on applets/applet_tables, |
| 47 | # and is generated by it. But specifying only it can run |
| 48 | # applets/applet_tables twice, possibly in parallel. |
| 49 | # We say that it also needs NUM_APPLETS.h |
| 50 | # |
| 51 | # Unfortunately, we need to list the same command, |
| 52 | # and it can be executed twice (sequentially). |
| 53 | # The alternative is to not list any command, |
| 54 | # and then if include/applet_tables.h is deleted, it won't be rebuilt. |
| 55 | # |
| 56 | include/applet_tables.h: include/NUM_APPLETS.h applets/applet_tables |
Denys Vlasenko | bff5f3f | 2011-03-06 23:48:24 +0100 | [diff] [blame] | 57 | $(call cmd,gen_applet_tables) |