/[baselayout]/trunk/default.mk
Gentoo

Contents of /trunk/default.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2895 - (hide annotations) (download)
Wed Sep 19 13:53:40 2007 UTC (7 years, 2 months ago) by uberlord
File size: 1965 byte(s)
/lib/rcscripts -> /lib/rc
1 uberlord 2547 # Common makefile settings
2     # Copyright 2006-2007 Gentoo Foundation
3    
4     DESTDIR = /
5     ROOT = /
6     LIB = lib
7 uberlord 2895 RC_LIB = /$(LIB)/rc
8 uberlord 2547
9     #
10     # Recursive rules
11     #
12    
13     SUBDIRS_ALL = $(patsubst %,%_all,$(SUBDIRS))
14     SUBDIRS_CLEAN = $(patsubst %,%_clean,$(SUBDIRS))
15     SUBDIRS_INSTALL = $(patsubst %,%_install,$(SUBDIRS))
16    
17     all:: $(SUBDIRS_ALL)
18     clean:: $(SUBDIRS_CLEAN)
19     install:: $(SUBDIRS_INSTALL)
20    
21     # Hmm ... possible to combine these three and not be ugly ?
22     %_all:
23     $(MAKE) -C $(patsubst %_all,%,$@) all
24     if test -d $(patsubst %_all,%,$@).$(OS) ; then $(MAKE) -C $(patsubst %_all,%,$@).$(OS) all ; fi
25     %_clean:
26     $(MAKE) -C $(patsubst %_clean,%,$@) clean
27     if test -d $(patsubst %_clean,%,$@).$(OS) ; then $(MAKE) -C $(patsubst %_clean,%,$@).$(OS) clean ; fi
28     %_install:
29     $(MAKE) -C $(patsubst %_install,%,$@) install
30     if test -d $(patsubst %_install,%,$@).$(OS) ; then $(MAKE) -C $(patsubst %_install,%,$@).$(OS) install ; fi
31    
32    
33     #
34     # Install rules
35     #
36    
37     INSTALL_DIR = install -m 0755 -d
38     INSTALL_EXE = install -m 0755
39     INSTALL_FILE = install -m 0644
40     INSTALL_SECURE = install -m 0600
41    
42     install:: $(EXES) $(FILES) $(FILES_NOEXIST) $(MANS)
43     test -n $(DIR) && $(INSTALL_DIR) $(DESTDIR)$(DIR)
44     for x in $(EXES) ; do $(INSTALL_EXE) $$x $(DESTDIR)$(DIR) || exit $$? ; done
45     for x in $(FILES) ; do $(INSTALL_FILE) $$x $(DESTDIR)$(DIR) || exit $$? ; done
46     for x in $(FILES_APPEND) ; do if test -e $(DESTDIR)$(DIR)/$$x ; then cat $$x >> $(DESTDIR)$(DIR)/$$x || exit $$? ; else $(INSTALL_FILE) $$x $(DESTDIR)$(DIR) || exit $$? ; fi ; done
47     for x in $(FILES_NOEXIST) ; do if ! test -e $(DESTDIR)$(DIR)/$$x ; then $(INSTALL_FILE) $$x $(DESTDIR)$(DIR) || exit $$? ; fi ; done
48     for x in $(FILES_SECURE) ; do $(INSTALL_SECURE) $$x $(DESTDIR)$(DIR) || exit $$? ; done
49     for x in $(MANS) ; do \
50     ext=`echo $$x | sed -e 's/^.*\\.//'` ; \
51     $(INSTALL_DIR) $(DESTDIR)$(DIR)/man$$ext || exit $$? ; \
52     $(INSTALL_FILE) $$x $(DESTDIR)$(DIR)/man$$ext || exit $$? ; \
53     done
54    
55     .PHONY: all clean install

  ViewVC Help
Powered by ViewVC 1.1.20