Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 18 17:41:58 2009 +0000 (2009-01-18)
changeset 1142 6ed79762fd99
parent 1141 60cda89df6cf
child 1152 73a8bb20ccf2
permissions -rw-r--r--
Fix Makefile.in to use the correct variables.

/trunk/Makefile.in | 16 8 8 0 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
     1 # Makefile.in for building crosstool-NG
     2 # This file serves as source for the ./configure operation
     3 
     4 MAKEFLAGS += --no-print-directory --no-builtin-rules
     5 
     6 all: Makefile build
     7 
     8 ###############################################################################
     9 # Configuration variables
    10 
    11 VERSION:= @@VERSION@@
    12 BINDIR := @@BINDIR@@
    13 LIBDIR := @@LIBDIR@@
    14 DOCDIR := @@DOCDIR@@
    15 MANDIR := @@MANDIR@@
    16 DATE   := @@DATE@@
    17 LOCAL  := @@LOCAL@@
    18 
    19 # Paths found by ./configure
    20 CT_install:=@@install@@
    21 CT_make   :=@@make@@
    22 CT_bash   :=@@bash@@
    23 CT_grep   :=@@grep@@
    24 CT_awk    :=@@awk@@
    25 CT_sed    :=@@sed@@
    26 
    27 ###############################################################################
    28 # Sanity checks
    29 
    30 # Check if Makefile is up to date:
    31 Makefile: Makefile.in
    32 	@echo "$< did changed: you must re-run './configure'"
    33 	@false
    34 
    35 # If installing with DESTDIR, check it's an absolute path
    36 ifneq ($(strip $(DESTDIR)),)
    37   ifneq ($(DESTDIR),$(abspath /$(DESTDIR)))
    38     $(error DESTDIR is not an absolute PATH: '$(DESTDIR)')
    39   endif
    40 endif
    41 
    42 ###############################################################################
    43 # Global make rules
    44 
    45 TARGETS := bin lib doc man
    46 
    47 build: $(patsubst %,build-%,$(TARGETS))
    48 
    49 install: build real-install
    50 
    51 clean: $(patsubst %,clean-%,$(TARGETS))
    52 
    53 distclean: clean
    54 	@echo "  RM     'Makefile'"
    55 	@rm -f Makefile
    56 
    57 uninstall: real-uninstall
    58 
    59 ###############################################################################
    60 # Specific make rules
    61 
    62 #--------------------------------------
    63 # Build rules
    64 
    65 build-bin: ct-ng
    66 
    67 build-lib:
    68 
    69 build-doc:
    70 
    71 build-man: docs/ct-ng.1.gz
    72 
    73 docs/ct-ng.1.gz: docs/ct-ng.1
    74 	@echo "  GZIP   '$@'"
    75 	@gzip -c9 $< >$@
    76 
    77 %: %.in Makefile
    78 	@echo "  SED    '$@'"
    79 	@$(CT_sed) -r -e 's,@@CT_BINDIR@@,$(BINDIR),g;' \
    80 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'       \
    81 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'       \
    82 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'       \
    83 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	    \
    84 	        -e 's,@@CT_DATE@@,$(DATE),g;'           \
    85 	        -e 's,@@CT_install@@,$(CT_install),g;'  \
    86 	        -e 's,@@CT_make@@,$(CT_make),g;'        \
    87 	        -e 's,@@CT_bash@@,$(CT_bash),g;'        \
    88 	        -e 's,@@CT_grep@@,$(CT_grep),g;'        \
    89 	        -e 's,@@CT_awk@@,$(CT_awk),g;'          \
    90 	        -e 's,@@CT_sed@@,$(CT_sed),g;'          \
    91 	        $@.in >$@
    92 
    93 #--------------------------------------
    94 # Clean rules
    95 
    96 clean-bin:
    97 	@echo "  RM     'ct-ng'"
    98 	@rm -f ct-ng
    99 
   100 clean-lib:
   101 
   102 clean-doc:
   103 
   104 clean-man:
   105 	@echo "  RM     'docs/ct-ng.1'"
   106 	@rm -f docs/ct-ng.1
   107 	@echo "  RM     'docs/ct-ng.1.gz'"
   108 	@rm -f docs/ct-ng.1.gz
   109 
   110 #--------------------------------------
   111 # Check for --local setup
   112 
   113 ifeq ($(strip $(LOCAL)),1)
   114 
   115 real-install:
   116 	@echo "  CHMOD  'ct-ng'"
   117 	@chmod a+x ct-ng
   118 
   119 real-uninstall:
   120 	@true
   121 
   122 else
   123 
   124 #--------------------------------------
   125 # Install rules
   126 
   127 real-install: $(patsubst %,install-%,$(TARGETS))
   128 
   129 install-bin: $(DESTDIR)$(BINDIR)
   130 	@echo "  INST   'ct-ng'"
   131 	@$(CT_install) -m 755 ct-ng "$(DESTDIR)$(BINDIR)/ct-ng"
   132 
   133 # If one is hacking crosstool-NG, the patch set might change between any two
   134 # installations of the same VERSION, thus the patches must be removed prior
   135 # to being installed. It is simpler to remove the whole lib/ directory, as it
   136 # is the goal of the install-lib rule to install the lib/ directory...
   137 install-lib: uninstall-lib $(DESTDIR)$(LIBDIR) install-lib-main install-lib-samples
   138 
   139 install-lib-main: $(DESTDIR)$(LIBDIR)
   140 	@for src_dir in config kconfig patches scripts; do                              \
   141 	     echo "  INST   '$${src_dir}/'";                                            \
   142 	     tar cf - --exclude=.svn $${src_dir} |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -); \
   143 	 done
   144 	@rm -f "$(DESTDIR)$(LIBDIR)/scripts/addToolVersion.sh"
   145 	@echo "  INST   'steps.mk'"
   146 	@$(CT_install) -m 644 steps.mk "$(DESTDIR)$(LIBDIR)/steps.mk"
   147 
   148 # Samples need a little love:
   149 #  - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
   150 install-lib-samples: $(DESTDIR)$(LIBDIR) install-lib-main
   151 	@echo "  INST   'samples/'"
   152 	@tar cf - --exclude=.svn samples |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -)
   153 	@for samp_file in "$(DESTDIR)$(LIBDIR)/samples/"*"/crosstool.config"; do                    \
   154 	     $(CT_sed) -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file};           \
   155 	     $(CT_sed) -r -i -e 's,^(CT_WORK_DIR)=.*,\1="\$${CT_TOP_DIR}/targets",;' $${samp_file}; \
   156 	 done
   157 
   158 install-doc: $(DESTDIR)$(DOCDIR)
   159 	@for doc_file in docs/CREDITS docs/overview.txt; do             \
   160 	     echo "  INST   '$${doc_file}'";                            \
   161 	     $(CT_install) -m 644 "$${doc_file}" "$(DESTDIR)$(DOCDIR)"; \
   162 	 done
   163 
   164 install-man: $(DESTDIR)$(MANDIR)
   165 	@echo "  INST   'ct-ng.1.gz'"
   166 	@$(CT_install) -m 644 docs/ct-ng.1.gz "$(DESTDIR)$(MANDIR)"
   167 
   168 $(sort $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(DOCDIR) $(DESTDIR)$(MANDIR)):
   169 	@echo "  MKDIR  '$@'"
   170 	@$(CT_install) -m 755 -d "$@"
   171 
   172 
   173 #--------------------------------------
   174 # Uninstall rules
   175 
   176 real-uninstall: $(patsubst %,uninstall-%,$(TARGETS))
   177 
   178 uninstall-bin:
   179 	@echo "  RM     '$(DESTDIR)$(BINDIR)/ct-ng'"
   180 	@rm -f "$(DESTDIR)$(BINDIR)/ct-ng"
   181 
   182 uninstall-lib:
   183 	@echo "  RMDIR  '$(DESTDIR)$(LIBDIR)/'"
   184 	@rm -rf "$(DESTDIR)$(LIBDIR)"
   185 
   186 uninstall-doc:
   187 	@echo "  RMDIR  '$(DESTDIR)$(DOCDIR)/'"
   188 	@rm -rf "$(DESTDIR)$(DOCDIR)"
   189 
   190 uninstall-man:
   191 	@echo "  RM     '$(DESTDIR)$(MANDIR)/ct-ng.1.gz'"
   192 	@rm -f "$(DESTDIR)$(MANDIR)/ct-ng.1"{,.gz}
   193 
   194 endif # Not --local