Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 16 16:35:15 2007 +0000 (2007-07-16)
changeset 269 9649a1d5ac2f
parent 249 bc6c64dab0de
child 276 835178a32fc1
permissions -rw-r--r--
Update TODO.
     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 MAKE   := $(shell which make || type -p make || echo /usr/bin/make)
    16 
    17 ###############################################################################
    18 # Global make rules
    19 
    20 build: build-bin build-lib build-doc
    21 
    22 install: build install-bin install-lib install-doc
    23 
    24 clean: clean-bin clean-lib clean-doc
    25 
    26 distclean: clean
    27 	@rm -f Makefile
    28 
    29 uninstall: uninstall-bin uninstall-lib uninstall-doc
    30 
    31 ###############################################################################
    32 # Specific make rules
    33 
    34 #--------------------------------------
    35 # Build rules
    36 
    37 build-bin: ct-ng
    38 	@chmod a+x ct-ng
    39 
    40 build-lib:
    41 
    42 build-doc: docs/ct-ng.1
    43 
    44 %: %.in
    45 	@echo "  SED    $@"
    46 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    47 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    48 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    49 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    50 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    51 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    52 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    53 	     $@.in >$@
    54 
    55 #--------------------------------------
    56 # Clean rules
    57 
    58 clean-bin:
    59 	@rm -f ct-ng
    60 
    61 clean-lib:
    62 
    63 clean-doc:
    64 	@rm -f docs/ct-ng.1
    65 
    66 #--------------------------------------
    67 # Install rules
    68 
    69 install-bin: install-lib $(BINDIR)
    70 	@echo "  INST   ct-ng"
    71 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    72 	@echo "  LN     ct-ng.extract-config"
    73 	@ln -sf $(LIBDIR)/tools/ct-ng.extract-config $(BINDIR)/ct-ng.extract-config
    74 
    75 install-lib: $(LIBDIR) install-lib-main install-lib-samples
    76 
    77 install-lib-main: $(LIBDIR)
    78 	@for src_dir in config kconfig patches scripts tools; do            \
    79 	     echo "  INST   $${src_dir}/";                                  \
    80 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    81 	 done
    82 	@rm -f $(LIBDIR)/tools/addToolVersion.sh
    83 	@for src_file in steps.mk version; do                 \
    84 	     echo "  INST   $${src_file}";                          \
    85 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    86 	 done
    87 
    88 # Samples need a little love:
    89 #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    90 install-lib-samples: $(LIBDIR) install-lib-main
    91 	@echo "  INST   samples/"
    92 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
    93 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
    94 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
    95 	 done
    96 
    97 install-doc: install-man $(DOCDIR)
    98 	@for doc_file in CREDITS docs/overview.txt; do  \
    99 	     echo "  INST   $${doc_file}";              \
   100 	     install -m 644 "$${doc_file}" $(DOCDIR);   \
   101 	 done
   102 
   103 install-man: $(MANDIR)
   104 	@echo "  INST   ct-ng.1"
   105 	@install -m 644 docs/ct-ng.1 $(MANDIR)
   106 
   107 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
   108 	@echo "  MKDIR  $@"
   109 	@install -m 755 -d $@
   110 
   111 
   112 #--------------------------------------
   113 # Uninstall rules
   114 
   115 uninstall-bin:
   116 	@rm -f $(BINDIR)/ct-ng
   117 	@rm -f $(BINDIR)/ct-ng.extract-config
   118 
   119 uninstall-lib:
   120 	@rm -rf $(LIBDIR)
   121 
   122 uninstall-doc:
   123 	@rm -rf $(DOCDIR)
   124 	@rm -f $(MANDIR)/ct-ng.1