/[baselayout]/trunk/default.mk
Gentoo

Contents of /trunk/default.mk

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20