Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jul 12 08:47:15 2007 +0000 (2007-07-12)
changeset 236 42650dc4e95e
parent 223 918b55e0e4a1
child 249 bc6c64dab0de
permissions -rw-r--r--
Add D.U.M.A., the Electric Fence successor.
     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 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    46 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    47 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    48 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    49 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    50 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    51 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    52 	     $@.in >$@
    53 
    54 #--------------------------------------
    55 # Clean rules
    56 
    57 clean-bin:
    58 	@rm -f ct-ng
    59 
    60 clean-lib:
    61 
    62 clean-doc:
    63 	@rm -f docs/ct-ng.1
    64 
    65 #--------------------------------------
    66 # Install rules
    67 
    68 install-bin: $(BINDIR)
    69 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    70 	@ln -sf $(LIBDIR)/tools/ct-ng.extract-config $(BINDIR)/ct-ng.extract-config
    71 
    72 install-lib: $(LIBDIR) install-lib-main install-lib-samples
    73 
    74 install-lib-main: $(LIBDIR)
    75 	@for src_dir in config kconfig patches scripts tools; do            \
    76 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    77 	 done
    78 	@rm -f $(LIBDIR)/tools/addToolVersion.sh
    79 	@for src_file in Makefile.steps version; do                 \
    80 	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    81 	 done
    82 
    83 # Samples need a little love:
    84 #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    85 install-lib-samples: $(LIBDIR) install-lib-main
    86 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
    87 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
    88 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
    89 	 done
    90 
    91 install-doc: $(DOCDIR) $(MANDIR)
    92 	@for doc_file in CREDITS docs/overview.txt; do  \
    93 	     install -m 644 "$${doc_file}" $(DOCDIR);   \
    94 	 done
    95 	@install -m 644 docs/ct-ng.1 $(MANDIR)
    96 
    97 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
    98 	@install -m 755 -d $@
    99 
   100 
   101 #--------------------------------------
   102 # Uninstall rules
   103 
   104 uninstall-bin:
   105 	@rm -f $(BINDIR)/ct-ng
   106 
   107 uninstall-lib:
   108 	@rm -rf $(LIBDIR)
   109 
   110 uninstall-doc:
   111 	@rm -rf $(DOCDIR)
   112 	@rm -f $(MANDIR)/ct-ng.1