Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:08:06 2008 +0000 (2008-02-17)
changeset 431 8bde4c6ea47a
parent 396 05550a6b9ff0
child 435 ff598e5b4bb5
permissions -rw-r--r--
Robert P. J. DAY says:

apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
     1 # Makefile.in for building crosstool-NG
     2 # This file serves as source for the ./configure operation
     3 
     4 all: Makefile build
     5 
     6 # Check if Makefile is up to date:
     7 Makefile: Makefile.in
     8 	@echo "$< did changed: you must re-run './configure'"
     9 	@false
    10 
    11 ###############################################################################
    12 # Configuration variables
    13 
    14 VERSION:= @@VERSION@@
    15 BINDIR := @@BINDIR@@
    16 LIBDIR := @@LIBDIR@@
    17 DOCDIR := @@DOCDIR@@
    18 MANDIR := @@MANDIR@@
    19 DATE   := @@DATE@@
    20 LOCAL  := @@LOCAL@@
    21 MAKE   := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
    22 
    23 ###############################################################################
    24 # Global make rules
    25 
    26 build: build-bin build-lib build-man
    27 
    28 install: install-local-test build install-bin install-lib install-doc install-man
    29 
    30 clean: clean-bin clean-lib clean-doc
    31 
    32 distclean: clean
    33 	@echo "  RM     Makefile"
    34 	@rm -f Makefile
    35 
    36 uninstall: install-local-test uninstall-bin uninstall-lib uninstall-doc uninstall-man
    37 
    38 ###############################################################################
    39 # Specific make rules
    40 
    41 #--------------------------------------
    42 # Build rules
    43 
    44 build-bin: ct-ng
    45 	@echo "  CHMOD  $<"
    46 	@chmod a+x $<
    47 
    48 build-lib:
    49 
    50 build-man: docs/ct-ng.1.gz
    51 
    52 docs/ct-ng.1.gz: docs/ct-ng.1
    53 	@echo "  GZIP   $@"
    54 	@gzip -c9 $< >$@
    55 
    56 %: %.in
    57 	@echo "  SED    $@"
    58 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    59 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    60 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    61 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    62 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    63 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    64 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    65 	     $@.in >$@
    66 
    67 #--------------------------------------
    68 # Clean rules
    69 
    70 clean-bin:
    71 	@echo "  RM     ct-ng"
    72 	@rm -f ct-ng
    73 
    74 clean-lib:
    75 
    76 clean-doc:
    77 	@echo "  RM     docs/ct-ng.1"
    78 	@rm -f docs/ct-ng.1
    79 	@echo "  RM     docs/ct-ng.1.gz"
    80 	@rm -f docs/ct-ng.1.gz
    81 
    82 #--------------------------------------
    83 # Install rules
    84 
    85 # If using locally, don't install
    86 install-local-test:
    87 	@if [ "$(LOCAL)" = "1" ]; then                                          \
    88 	     echo "You're using local copy as runtime. You can't (un)install."; \
    89 	     false;                                                             \
    90 	 fi
    91 
    92 install-bin: install-local-test $(BINDIR)
    93 	@echo "  INST   ct-ng"
    94 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    95 
    96 install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
    97 
    98 install-lib-main: install-local-test $(LIBDIR)
    99 	@for src_dir in arch config kconfig patches scripts tools; do            \
   100 	     echo "  INST   $${src_dir}/";                                  \
   101 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
   102 	 done
   103 	@rm -f $(LIBDIR)/tools/addToolVersion.sh
   104 	@for src_file in steps.mk .version; do                 \
   105 	     echo "  INST   $${src_file}";                          \
   106 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
   107 	 done
   108 
   109 # Samples need a little love:
   110 #  - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
   111 install-lib-samples: install-local-test $(LIBDIR) install-lib-main
   112 	@echo "  INST   samples/"
   113 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
   114 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
   115 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
   116 	 done
   117 
   118 install-doc: install-local-test $(DOCDIR)
   119 	@for doc_file in docs/CREDITS docs/overview.txt; do	\
   120 	     echo "  INST   $${doc_file}";              	\
   121 	     install -m 644 "$${doc_file}" $(DOCDIR);   	\
   122 	 done
   123 
   124 install-man: install-local-test $(MANDIR)
   125 	@echo "  INST   ct-ng.1.gz"
   126 	@install -m 644 docs/ct-ng.1.gz $(MANDIR)
   127 
   128 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
   129 	@echo "  MKDIR  $@"
   130 	@install -m 755 -d $@
   131 
   132 
   133 #--------------------------------------
   134 # Uninstall rules
   135 
   136 uninstall-bin: install-local-test
   137 	@rm -f $(BINDIR)/ct-ng
   138 
   139 uninstall-lib: install-local-test
   140 	@rm -rf $(LIBDIR)
   141 
   142 uninstall-doc: install-local-test
   143 	@rm -rf $(DOCDIR)
   144 
   145 uninstall-man: install-local-test
   146 	@rm -f $(MANDIR)/ct-ng.1{,.gz}