source: freewrt/tools/Makefile@ c2e2d0c

freewrt_1_0 freewrt_2_0
Last change on this file since c2e2d0c was c2e2d0c, checked in by Thorsten Glaser <tg@…>, 19 years ago

sanitise the way tools which must be in lbin/ (currently,
sed and pax/cpio/tar, but there will be more...) are handled:
make prereq invokes a special recursive target install-lbin
which copies them from the staging dir into lbin if they exist
there (i.e. are already installed), or removes the install stamp
otherwise. the tools' install-lbin target does however duplicate
a little code, this could be done better but it works OK like this

also, add a missing include to brcm-utils and fix pax' clean target

git-svn-id: svn://www.freewrt.org/trunk/freewrt@339 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# $FreeWRT$
2
3include $(TOPDIR)/rules.mk
4
5TARGETS:= paxmirabilis sed ipkg-utils brcm-utils lzma
6TARGETS+= squashfs jffs2
7ifeq (${OStype},Linux)
8TARGETS+= mkpasswd
9endif
10
11TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
12TARGETS_INSTALL_LBIN:=$(patsubst %,%-install-lbin,$(TARGETS))
13TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
14
15all: install
16install: $(TARGETS_INSTALL)
17install-lbin: $(TARGETS_INSTALL_LBIN)
18clean: $(TARGETS_CLEAN)
19
20$(STAGING_DIR):
21 @mkdir -p $(STAGING_DIR)/lib
22 @mkdir -p $(STAGING_DIR)/include
23
24$(TOOLS_STAMP_DIR):
25 @mkdir -p $(TOOLS_STAMP_DIR)
26
27$(TOOLS_BUILD_DIR):
28 @mkdir -p $(TOOLS_BUILD_DIR)
29
30%-prepare: $(TOOLS_BUILD_DIR) $(TOOLS_STAMP_DIR)
31 @[ -f $(TOOLS_STAMP_DIR)/.tools_$@ ] || { \
32 $(TRACE) tools/$(patsubst %-prepare,%,$@)/prepare; \
33 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
34 CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
35 $(MAKE_TRACE); \
36 }
37 @touch $(TOOLS_STAMP_DIR)/.tools_$@
38
39%-compile: %-prepare
40 @[ -f $(TOOLS_STAMP_DIR)/.tools_$@ ] || { \
41 $(TRACE) tools/$(patsubst %-compile,%,$@)/compile; \
42 $(MAKE) -C $(patsubst %-compile,%,$@) compile \
43 CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
44 $(MAKE_TRACE); \
45 }
46 @touch $(TOOLS_STAMP_DIR)/.tools_$@
47
48%-install: %-compile
49 @[ -f $(TOOLS_STAMP_DIR)/.tools_$@ ] || { \
50 $(TRACE) tools/$(patsubst %-install,%,$@)/install; \
51 $(MAKE) -C $(patsubst %-install,%,$@) install \
52 CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
53 $(MAKE_TRACE); \
54 }
55 @touch $(TOOLS_STAMP_DIR)/.tools_$@
56
57%-install-lbin:
58 $(TRACE) tools/$(patsubst %-install-lbin,%,$@)/install-lbin; \
59 $(MAKE) -C $(patsubst %-install-lbin,%,$@) install-lbin \
60 $(MAKE_TRACE)
61
62%-clean:
63 $(TRACE) tools/$(patsubst %-clean,%,$@)/clean
64 @$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE_TRACE)
65 @rm -f $(TOOLS_STAMP_DIR)/.tools_$(patsubst %-clean,%,$@)-*
Note: See TracBrowser for help on using the repository browser.