2525
2626# $Id$
2727
28+ SHELL = /bin/bash
2829
29- # ========================================================================
30- # User configurable section
30+ PLATFORM =$(shell uname -s)
3131
32- # ------------------------------------------------------------------------
33- # Byte-compiling ECB:
34- # ------------------------------------------------------------------------
35-
36- # Define here the correct path to your Emacs or XEmacs binary. Ensure you
37- # have set this variable to 'xemacs' if you want byte-compile with XEmacs!
38- EMACS =emacs
39-
40- # In the following path-settings of this section use always FORWARD-SLASHES
41- # as directory-separator even with MS Windows systems.
42-
43- # -------- Compiling ECB with the cedet-library ----------------------
44-
45- # cedet >= 1.0pre6 (contains a.o. semantic >= 2.0, eieio >= 0.18 and
46- # speedbar >= 0.15).
4732#
48- # + If you use Emacs >= 23.2 and you want to use the integrated CEDET:
49- # Set this to empty (CEDET=)
33+ # Override vars in Makefile.conf if needed
5034#
51- # + If you use Emacs < 23.2 or if you want to use the author version of CEDET:
52- # Set this to the full path of your CEDET-installation.
53-
54- CEDET =
55- # CEDET=~/projects/cedet-bzr
56-
57- # You can set here more load-paths to arbitrary packages if you want. But
58- # this is really not necessary!
59- LOADPATH =
60-
61- # Two ways to build ECB:
62- # - Call "make" to byte-compile the ECB. You can savely ignore the messages.
63- # - Or call
64- #
65- # make [EMACS="path/to/emacs"] [CEDET="path/to/cedet" or empty]
66- #
67- # if you want to set either different load-paths or Emacs-binary and
68- # you do not want edit the Makefile. Do not forget quoting the arguments
69- # if they contain spaces!
70- #
71- # If there are any warning messages during byte-compilation (normally there
72- # are not any) you can savely ignore them!
73-
74-
75- # ------------------------------------------------------------------------
76- # Generating different online-help formats
77- # ------------------------------------------------------------------------
78-
79- # If you want to generate all formats of online-help from the texi-source
80- # you must set here the FULL paths to the required tools. The Makefile
81- # tests if the tools are available on these locations, so if a tool x is
82- # not available let the related setting X empty! NOTE: For generating the
83- # PDF-format you will need an installed TeX and Ghostscript!
84- MAKEINFO =/usr/bin/makeinfo
85- TEXI2DVI =/C/Programme/texmf/miktex/bin/texi2dvi
86- # You need either the dvipdfm-tool
87- # DVIPDFM=/C/Programme/texmf/miktex/bin/dvipdfm
88- DVIPDFM =
89- # or the tools dvips and ps2pdf. If dvipdfm is available the Makefile uses
90- # this one!
91- DVIPS =/C/Programme/texmf/miktex/bin/dvips
92- PS2PDF =/C/home/bin/ps2pdf
93-
94- # To generate the online-formats just call "make online-help" for info- and
95- # HTML-format and "make pdf" for PDF-format.
96-
97- # ------------------------------------------------------------------------
98- # Installing the info online-help in the Top-directory of (X)Emacs-info
99- # ------------------------------------------------------------------------
100-
101- # Set here the path of the info subdirectory of your (X)Emacs installation
102- # which contains the dir file.
103- EMACSINFOPATH =/C/Programme/emacs-22.3/info
104-
105- # If you want to install the info-format of the online-help in the
106- # Top-directory of the info-directory of (X)Emacs (see above EMACSINFOPATH)
107- # then you must specify the full path of the tool install-info.
108- INSTALLINFO =/usr/bin/install-info
109-
110- # To install the online-help just call "make install-help"
111-
112- # end of user configurable section
113- # ========================================================================
114-
115-
116- # ========================================================================
117- # !!!!!!!!!!!!!!!!!!!!! Do not change anything below !!!!!!!!!!!!!!!!!!!!!
118- # ========================================================================
119-
120-
121- # $Id$
35+ -include Makefile.conf
36+
37+ ifeq ($(wildcard Makefile.conf) ,)
38+ $(warning Makefile.conf not found. Using defaults for $(PLATFORM)!)
39+ $(warning Create Makefile.conf from Makefile.conf.template to override the defaults.)
40+ endif
41+
42+ # When run inside Emacs, the variable contains 't', so correct it
43+ ifeq ($(origin EMACS ) ,environment)
44+ EMACS = emacs
45+ endif
46+
47+ EMACS ?= emacs
48+
49+ # If it's one of Linux, Cygwin, or Darwin, use defaults.
50+ ifneq ($(filter Linux CYGWIN% Darwin, $(PLATFORM ) ) ,)
51+ EMACS ?= emacs
52+ CEDET ?=
53+ LOADPATH ?=
54+ MAKEINFO ?= makeinfo
55+ TEXI2PDF ?= texi2pdf
56+ TEXI2DVI ?= texi2dvi
57+ DVIPDFM ?= dvipdf
58+ DVIPS ?= dvips
59+ PS2PDF ?= ps2pdf
60+ EMACSINFOPATH ?=
61+ INSTALLINFO ?= install-info
62+ endif
12263
12364# For the ECB-maintainers: Change the version-number here and not
12465# elsewhere!
@@ -153,7 +94,7 @@ ecb: $(ecb_LISP_EL)
15394 @$(RM ) ecb-compile-script
15495
15596online-help : $(ecb_TEXI )
156- @if test -x " $( MAKEINFO) " ; then\
97+ @if command -v " $( MAKEINFO) " > /dev/null 2>&1 ; then\
15798 $(RM ) -R $(ecb_INFO_DIR ) $(ecb_HTML_DIR ) ; \
15899 $(MKDIR ) $(ecb_INFO_DIR ) $(ecb_HTML_DIR ) ; \
159100 echo Generating info-format...; \
@@ -174,13 +115,17 @@ online-help: $(ecb_TEXI)
174115 fi
175116
176117pdf : $(ecb_TEXI )
177- @if test -x " $( TEXI2DVI) " -a -x " $( DVIPDFM) " ; then\
118+ @if command -v " $( TEXI2PDF) " > /dev/null 2>&1 ; then\
119+ $(RM ) $(ecb_PDF ) ; \
120+ echo Generating pdf-format with texi2pdf ...; \
121+ $(TEXI2PDF ) --clean $< ; \
122+ elif command -v " $( TEXI2DVI) " > /dev/null 2>&1 -a command -v " $( DVIPDFM) " > /dev/null 2>&1 ; then\
178123 $(RM ) $(ecb_DVI ) $(ecb_PDF ) ; \
179124 echo Generating pdf-format with dvipdfm ...; \
180125 $(TEXI2DVI ) --clean $< ; \
181126 $(DVIPDFM ) $(ecb_DVI ) ; \
182127 $(RM ) $(ecb_DVI ) ; \
183- elif test -x " $( TEXI2DVI) " -a -x " $( DVIPS) " -a -x " $( PS2PDF) " ; then\
128+ elif command -v " $( TEXI2DVI) " > /dev/null 2>&1 -a command -v " $( DVIPS) " > /dev/null 2>&1 -a command -v " $( PS2PDF) " > /dev/null 2>&1 ; then\
184129 $(RM ) $(ecb_DVI ) $(ecb_PS ) $(ecb_PDF ) ; \
185130 echo Generating pdf-format with dvips and ps2pdf ...; \
186131 $(TEXI2DVI ) --quiet --clean $< ; \
@@ -189,6 +134,7 @@ pdf: $(ecb_TEXI)
189134 $(RM ) $(ecb_DVI ) $(ecb_PS ) ; \
190135 else \
191136 echo No pdf-format generating because at least one of the tools; \
137+ echo - texi2pdf in $(TEXI2PDF ) ; \
192138 echo - texi2dvi in $(TEXI2DVI ) ; \
193139 echo - dvips in $(DVIPS ) ; \
194140 echo - ps2pdf in $(PS2PDF ) ; \
@@ -197,7 +143,7 @@ pdf: $(ecb_TEXI)
197143
198144
199145install-help : $(ecb_INFO_DIR ) /$(ecb_INFO )
200- @if test -x " $( INSTALLINFO) " -a -f " $( EMACSINFOPATH) /dir" ; then\
146+ @if command -v " $( INSTALLINFO) " > /dev/null 2>&1 -a -f " $( EMACSINFOPATH) /dir" ; then\
201147 echo Installing the Online-help in $(EMACSINFOPATH ) ...; \
202148 $(CP ) $(ecb_INFO_DIR ) /* info* $(EMACSINFOPATH ) ; \
203149 $(INSTALLINFO ) $< $(EMACSINFOPATH ) /dir; \
@@ -258,4 +204,19 @@ distrib: $(ecb_INFO_DIR)/$(ecb_INFO) prepversion autoloads ecb
258204 @tar -cvzf ecb-$(ecb_VERSION ) .tar.gz ecb-$(ecb_VERSION )
259205 @$(RM ) -R ecb-$(ecb_VERSION )
260206
207+ printconf :
208+ @echo Platform: $(PLATFORM )
209+ @echo ECB version: $(ecb_VERSION )
210+ @echo Emacs: $(EMACS )
211+ @if test -n " ${CEDET} " ; then echo " CEDET: ${CEDET} " ; else echo " CEDET: Emacs-builtin" ; fi
212+ @echo Load path: $(LOADPATH )
213+ @echo Emacs info path: $(EMACSINFOPATH )
214+ @echo command -v " ${INSTALLINFO} " > /dev/null 2>&1 && echo " install-info: ${INSTALLINFO} " || echo " install-info: cannot execute ${INSTALLINFO} "
215+ @echo command -v " ${MAKEINFO} " > /dev/null 2>&1 && echo " makeinfo: ${MAKEINFO} " || echo " makeinfo: cannot execute ${MAKEINFO} "
216+ @echo command -v " ${TEXI2PDF} " > /dev/null 2>&1 && echo " texi2pdf: ${TEXI2PDF} " || echo " texi2pdf: cannot execute ${TEXI2PDF} "
217+ @echo command -v " ${TEXI2DVI} " > /dev/null 2>&1 && echo " texi2dvi: ${TEXI2DVI} " || echo " texi2dvi: cannot execute ${TEXI2DVI} "
218+ @echo command -v " ${DVIPDFM} " > /dev/null 2>&1 && echo " dvipdfm: ${DVIPDFM} " || echo " dvipdfm: cannot execute ${DVIPDFM} "
219+ @echo command -v " ${DVIPS} " > /dev/null 2>&1 && echo " dvips: ${DVIPS} " || echo " dvips: cannot execute ${DVIPS} "
220+ @echo command -v " ${PS2PDF} " > /dev/null 2>&1 && echo " ps2pdf: ${PS2PDF} " || echo " ps2pdf: cannot execute ${PS2PDF} "
221+
261222# End of Makefile
0 commit comments