Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
parent 296 5859cc5065a7
child 307 87aa66e584c0
permissions -rw-r--r--
Bump version to 0.2.2.
     1 # Makefile.in for building crosstool-NG
     2 # This file serves as source for the ./configure operation
     3 
     4 all: build
     5 
     6 ###############################################################################
     7 # Configuration variables
     8 
     9 VERSION:= @@VERSION@@
    10 BINDIR := @@BINDIR@@
    11 LIBDIR := @@LIBDIR@@
    12 DOCDIR := @@DOCDIR@@
    13 MANDIR := @@MANDIR@@
    14 DATE   := @@DATE@@
    15 LOCAL  := @@LOCAL@@
    16 MAKE   := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
    17 
    18 ###############################################################################
    19 # Global make rules
    20 
    21 build: build-bin build-lib build-doc
    22 
    23 install: install-local-test build install-bin install-lib install-doc install-man
    24 
    25 clean: clean-bin clean-lib clean-doc
    26 
    27 distclean: clean
    28 	@rm -f Makefile
    29 
    30 uninstall: install-local-test uninstall-bin uninstall-lib uninstall-doc uninstall-man
    31 
    32 ###############################################################################
    33 # Specific make rules
    34 
    35 #--------------------------------------
    36 # Build rules
    37 
    38 build-bin: ct-ng
    39 	@chmod a+x ct-ng
    40 
    41 build-lib:
    42 
    43 build-doc: docs/ct-ng.1
    44 
    45 %: %.in
    46 	@echo "  SED    $@"
    47 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    48 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    49 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    50 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    51 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    52 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    53 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    54 	     $@.in >$@
    55 
    56 #--------------------------------------
    57 # Clean rules
    58 
    59 clean-bin:
    60 	@rm -f ct-ng
    61 
    62 clean-lib:
    63 
    64 clean-doc:
    65 	@rm -f docs/ct-ng.1
    66 
    67 #--------------------------------------
    68 # Install rules
    69 
    70 # If using localy, don't install
    71 install-local-test:
    72 	@if [ "$(LOCAL)" = "1" ]; then                                          \
    73 	     echo "You're using local copy as runtime. You can't (un)install."; \
    74 	     false;                                                             \
    75 	 fi
    76 
    77 install-bin: install-local-test $(BINDIR)
    78 	@echo "  INST   ct-ng"
    79 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    80 
    81 install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
    82 
    83 install-lib-main: install-local-test $(LIBDIR)
    84 	@for src_dir in config kconfig patches scripts tools; do            \
    85 	     echo "  INST   $${src_dir}/";                                  \
    86 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    87 	 done
    88 	@rm -f $(LIBDIR)/tools/addToolVersion.sh
    89 	@for src_file in steps.mk version; do                 \
    90 	     echo "  INST   $${src_file}";                          \
    91 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    92 	 done
    93 
    94 # Samples need a little love:
    95 #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    96 install-lib-samples: install-local-test $(LIBDIR) install-lib-main
    97 	@echo "  INST   samples/"
    98 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
    99 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
   100 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
   101 	 done
   102 
   103 install-doc: install-local-test $(DOCDIR)
   104 	@for doc_file in docs/CREDITS docs/overview.txt; do	\
   105 	     echo "  INST   $${doc_file}";              	\
   106 	     install -m 644 "$${doc_file}" $(DOCDIR);   	\
   107 	 done
   108 
   109 install-man: install-local-test $(MANDIR)
   110 	@echo "  INST   ct-ng.1"
   111 	@install -m 644 docs/ct-ng.1 $(MANDIR)
   112 
   113 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
   114 	@echo "  MKDIR  $@"
   115 	@install -m 755 -d $@
   116 
   117 
   118 #--------------------------------------
   119 # Uninstall rules
   120 
   121 uninstall-bin: install-local-test
   122 	@rm -f $(BINDIR)/ct-ng
   123 
   124 uninstall-lib: install-local-test
   125 	@rm -rf $(LIBDIR)
   126 
   127 uninstall-doc: install-local-test
   128 	@rm -rf $(DOCDIR)
   129 
   130 uninstall-man: install-local-test
   131 	@rm -f $(MANDIR)/ct-ng.1