Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 02 19:40:54 2007 +0000 (2007-07-02)
changeset 197 9383bf4a2e2e
parent 194 efff45a9047f
child 198 47272dc0b12a
permissions -rw-r--r--
Get rid of eclipse fiels once and for all.
Homogenise the references to crosstool-NG:
- the project is named "crosstool-NG"
- the front-end is named "ct-ng"
- don't use shortcuts (such as "ct-ng" to stand for "crosstool-NG")
Default action is to print help.
Don't speak of make rules when dumping help, just speak of actions.
     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: build install-bin install-lib install-doc
    24 
    25 clean: clean-bin clean-lib clean-doc
    26 
    27 distclean: clean
    28 	@rm -f Makefile
    29 
    30 uninstall: uninstall-bin uninstall-lib uninstall-doc
    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 	@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 # If using localy, don't install
    70 install-local:
    71 	@if [ "$(LOCAL)" = "1" ]; then                                      \
    72 	     echo "You're using local copy as runtime. You can't install."; \
    73 	     false;                                                         \
    74 	 fi
    75 
    76 install-bin: install-local $(BINDIR)
    77 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    78 
    79 install-lib: install-local $(LIBDIR) install-lib-main install-lib-samples
    80 
    81 install-lib-main: install-local $(LIBDIR)
    82 	@for src_dir in config kconfig patches scripts tools; do            \
    83 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    84 	 done
    85 	@for src_file in Makefile.steps version; do                 \
    86 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    87 	 done
    88 
    89 # Samples need a little love:
    90 #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    91 install-lib-samples: install-local $(LIBDIR) install-lib-main
    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-local $(DOCDIR) $(MANDIR)
    98 	@for doc_file in CREDITS docs/overview.txt; do  \
    99 	     install -m 644 "$${doc_file}" $(DOCDIR);   \
   100 	 done
   101 	@install -m 644 docs/ct-ng.1 $(MANDIR)
   102 
   103 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
   104 	@install -m 755 -d $@
   105 
   106 
   107 #--------------------------------------
   108 # Uninstall rules
   109 
   110 uninstall-bin:
   111 	@rm -f $(BINDIR)/ct-ng
   112 
   113 uninstall-lib:
   114 	@rm -rf $(LIBDIR)
   115 
   116 uninstall-doc:
   117 	@rm -rf $(DOCDIR)
   118 	@rm -f $(MANDIR)/ct-ng.1