Skip to content

Commit e55344d

Browse files
committed
Merge pull request #16 from pwojnowski/master
Moved user options form Makefile to Makefile.conf
2 parents ded6481 + e67b2af commit e55344d

File tree

5 files changed

+177
-95
lines changed

5 files changed

+177
-95
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/html-help/
55
/info-help/
66
/ecb-autoloads.el
7+
Makefile.conf

Makefile

Lines changed: 55 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -25,100 +25,41 @@
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

15596
online-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

176117
pdf: $(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

199145
install-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

Makefile.conf.template

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#
2+
# Use 'make printconf' to print configuration variables.
3+
#
4+
5+
# Path to your Emacs or XEmacs binary. Set to 'xemacs' if you want byte-compile
6+
# with XEmacs!
7+
#EMACS =
8+
9+
# In the following path-settings of this section use always FORWARD-SLASHES
10+
# as directory-separator even with MS Windows systems.
11+
12+
# -------- Compiling ECB with the cedet-library ----------------------
13+
14+
# cedet >= 1.0pre6 (contains a.o. semantic >= 2.0, eieio >= 0.18 and
15+
# speedbar >= 0.15).
16+
#
17+
# + If you use Emacs >= 23.2 and you want to use the integrated CEDET:
18+
# Set this to empty (CEDET=)
19+
#
20+
# + If you use Emacs < 23.2 or if you want to use the author version of CEDET:
21+
# Set this to the full path of your CEDET-installation.
22+
#CEDET =
23+
24+
# You can set here more load-paths to arbitrary packages if you want. But
25+
# this is really not necessary!
26+
#LOADPATH =
27+
28+
# Two ways to build ECB:
29+
# - Call "make" to byte-compile the ECB. You can savely ignore the messages.
30+
# - Or call
31+
#
32+
# make [EMACS="path/to/emacs"] [CEDET="path/to/cedet" or empty]
33+
#
34+
# if you want to set either different load-paths or Emacs-binary and
35+
# you do not want edit the Makefile. Do not forget quoting the arguments
36+
# if they contain spaces!
37+
#
38+
# If there are any warning messages during byte-compilation (normally there
39+
# are not any) you can savely ignore them!
40+
41+
42+
# ------------------------------------------------------------------------
43+
# Generating different online-help formats
44+
# ------------------------------------------------------------------------
45+
46+
# If you want to generate all formats of online-help from the texi-source
47+
# you must set here the FULL paths to the required tools. The Makefile
48+
# tests if the tools are available on these locations, so if a tool x is
49+
# not available let the related setting X empty! NOTE: For generating the
50+
# PDF-format you will need an installed TeX and Ghostscript!
51+
#MAKEINFO =
52+
#TEXI2PDF=
53+
#TEXI2DVI =
54+
55+
# You need either the dvipdfm-tool
56+
#DVIPDFM =
57+
58+
# or the tools dvips and ps2pdf. If dvipdfm is available the Makefile uses
59+
# this one!
60+
#DVIPS =
61+
#PS2PDF =
62+
63+
# To generate the online-formats just call "make online-help" for info- and
64+
# HTML-format and "make pdf" for PDF-format.
65+
66+
# ------------------------------------------------------------------------
67+
# Installing the info online-help in the Top-directory of (X)Emacs-info
68+
# ------------------------------------------------------------------------
69+
70+
# Set here the path of the info subdirectory of your (X)Emacs installation
71+
# which contains the dir file.
72+
#EMACSINFOPATH =
73+
74+
# If you want to install the info-format of the online-help in the
75+
# Top-directory of the info-directory of (X)Emacs (see above EMACSINFOPATH)
76+
# then you must specify the full path of the tool install-info.
77+
#INSTALLINFO =
78+
79+
# To install the online-help just call "make install-help"

README

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ these optional installation steps:
178178
But it doesn't matter if you do not execute this step (8.) because the
179179
online help of ECB is always available though, see `ecb-show-help'.
180180

181+
--------------
182+
Using Makefile
183+
--------------
184+
Makefile can be configured using Makefile.conf, for which there is a template in
185+
Makefile.conf.template. Usually it's enough to set a path to CEDET (if you use
186+
repo version) and EMACSINFOPATH to local (e.g. ~/.emacs.d/info).
187+
188+
For Linux, Makefile tries to use reasonable defaults.
189+
190+
You can print configuration used in Makefile using `make printconf'.
181191

182192
-----
183193
Usage

ecb.texi

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ Installation of ECB
193193
* Requirements:: Requirements for ECB
194194
* ECB as XEmacs-package:: Installation of ECB as a XEmacs-package
195195
* Standard ECB-Installation:: Standard installation of ECB for (X)Emacs
196+
* Makefile customization:: Customizing build using Makefile.conf
196197

197198
How to set up Emacs for file parsing with ECB
198199

@@ -412,6 +413,7 @@ This section describes how to install ECB.
412413
* Requirements:: Requirements for ECB
413414
* ECB as XEmacs-package:: Installation of ECB as a XEmacs-package
414415
* Standard ECB-Installation:: Standard installation of ECB for (X)Emacs
416+
* Makefile customization:: Customizing build using Makefile.conf
415417
@end menu
416418

417419
@node Requirements, ECB as XEmacs-package, Installation, Installation
@@ -543,7 +545,7 @@ described in the next section (@pxref{Standard ECB-Installation}).
543545
@c installing ECB ``by hand'' direct from the ECB-website then you have
544546
@c to follow the instructions in @ref{Standard ECB-Installation}.
545547

546-
@node Standard ECB-Installation, , ECB as XEmacs-package, Installation
548+
@node Standard ECB-Installation, Makefile customization, ECB as XEmacs-package, Installation
547549
@subsection Standard installation of ECB for (X)Emacs
548550

549551
Follow exatly these steps to install ECB:
@@ -657,6 +659,9 @@ are any. (You can also bytecompile ECB from the command-line either by
657659
using the @file{Makefile} or by using the batch-file @file{make.bat};
658660
just read the comments in that file you choose.)
659661

662+
@file{Mekefile} can be customized using @file{Makefile.conf}
663+
(@pxref{Makefile customization}).
664+
660665
@item Installing the Info-help of ECB
661666

662667
The ECB distribution contains a subdirectory @file{info-help} which
@@ -698,6 +703,32 @@ online help of ECB is always available though, see
698703

699704
@end enumerate
700705

706+
@node Makefile customization, , Standard ECB-Installation, Installation
707+
@subsection Customizing build using Makefile.conf
708+
709+
Platform specific vars and programs can be customized from a
710+
command-line or by means of @file{Makefile.conf}, for which
711+
@file{Makefile.conf.template} is a template. It contains descriptions
712+
of all configuration options. Copy it to @file{Makefile.conf} and
713+
override as needed.
714+
715+
If settings hasn't been changed, @file{Makefile} uses platform
716+
specific defaults.
717+
718+
There is a target, that prints configuration values: @code{make
719+
printconf}.
720+
721+
When you use CEDET built into Emacs and don't install help, then you
722+
don't even need the @file{Makefile.conf}.
723+
724+
When you use CEDET from the repo and/or want to install info files,
725+
then set appropriate variables in @file{Makefile.conf}, for example:
726+
727+
@example
728+
CEDET = ~/projects/cedet-bzr
729+
EMACSINFOPATH = ~/.emacs.d/info
730+
@end example
731+
701732
@node Setting up Emacs, First steps, Installation, Install and first steps
702733
@section How to set up Emacs for file parsing with ECB
703734

0 commit comments

Comments
 (0)