Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 01 19:04:20 2007 +0000 (2007-07-01)
changeset 182 223c84ec2d90
child 184 62a30ab8ae56
permissions -rw-r--r--
Merge the build system to trunk: ct-ng is now installable:
- ./configure --prefix=/some/place
- make
- make install
- export PATH="${PATH}:/some/place/bin"
- ct-ng <action>
     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@@/ct-ng-$(VERSION)
    12 DOCDIR := @@DOCDIR@@/ct-ng-$(VERSION)
    13 MANDIR := @@MANDIR@@/man1
    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 
    39 build-lib:
    40 
    41 build-doc: docs/ct-ng.1
    42 
    43 %: %.in
    44 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    45 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    46 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    47 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    48 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    49 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    50 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    51 	     $@.in >$@
    52 
    53 #--------------------------------------
    54 # Clean rules
    55 
    56 clean-bin:
    57 	@rm -f ct-ng
    58 
    59 clean-lib:
    60 
    61 clean-doc:
    62 	@rm -f docs/ct-ng.1
    63 
    64 #--------------------------------------
    65 # Install rules
    66 
    67 install-bin: $(BINDIR)
    68 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    69 
    70 install-lib: $(LIBDIR) install-lib-main install-lib-samples
    71 
    72 install-lib-main: $(LIBDIR)
    73 	@for src_dir in config kconfig patches scripts tools; do            \
    74 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    75 	 done
    76 	@for src_file in Makefile.steps version; do                 \
    77 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    78 	 done
    79 
    80 # Samples need a little love:
    81 #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    82 install-lib-samples: $(LIBDIR) install-lib-main
    83 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
    84 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do					\
    85 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
    86 	 done
    87 
    88 install-doc: $(DOCDIR) $(MANDIR)
    89 	@for doc_file in LICENSES licenses.d COPYING CREDITS docs/overview.txt; do	\
    90 	     install -m 644 docs/overview.txt $(DOCDIR);    						\
    91 	 done
    92 	@install -m 644 docs/ct-ng.1 $(MANDIR)
    93 
    94 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR):
    95 	@install -m 755 -d $@
    96 
    97 
    98 #--------------------------------------
    99 # Uninstall rules
   100 
   101 uninstall-bin:
   102 	@rm -f $(BINDIR)/ct-ng
   103 
   104 uninstall-lib:
   105 	@rm -rf $(LIBDIR)
   106 
   107 uninstall-doc:
   108 	@rm -rf $(DOCDIR)
   109 	@rm -f $(MANDIR)/ct-ng.1