Initial git import
[sxemacs] / Makefile.am
1 ## SXEmacs toplevel Makefile.am
2
3 ## Copyright (C) 2007 Steve Youngs
4
5 ## This file is part of SXEmacs.
6
7 ## SXEmacs is free software: you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation, either version 3 of the License, or
10 ## (at your option) any later version.
11
12 ## SXEmacs is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ## GNU General Public License for more details.
16
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 ## Process this file with automake to produce Makefile.in
21
22 # Help the Developers and yourself. Just use the C locale and settings
23 # for the compilation. They can still be overriden by make LANG=<whatever>
24 # but that is general a not very good idea
25 LANG=C
26 LC_ALL=C
27
28 ACLOCAL_AMFLAGS = -I m4
29
30 builddir = @builddir@
31 srcdir = @srcdir@
32 top_builddir = .
33 top_build_prefix = $(top_builddir)/
34 top_srcdir = @top_srcdir@
35 abs_top_builddir = @abs_top_builddir@
36 abs_top_srcdir = @abs_top_srcdir@
37
38 archlibdir = ${libdir}/${instvardir}/${configuration}
39 etcdir = ${datadir}/${instvardir}/etc
40
41 ETAGS = $(top_builddir)/lib-src/etags
42 TAGS_DEPENDENCIES = $(ETAGS)
43
44 EXTRA_DIST = autogen.sh sxemacs_version.m4
45
46 REPORT_VARS=PATH LD_LIBRARY_PATH LIBRARY_PATH SHLIB_PATH DYLD_LIBRARY_PATH CC CPATH CPPFLAGS CFLAGS LDFLAGS INCLUDE_PATH C_INCLUDE_PATH SHELL GCC_EXEC_PREFIX COMPILER_PATH DEPENDENCIES_OUTPUT GNUTARGET LDEMULATION
47
48 ## we do not use automake's SUBDIRS thingie
49 sxe_subdirs =
50 if DESCEND_LIBLTDL
51 sxe_subdirs += libltdl
52 endif
53 sxe_subdirs += lib-src
54 if DESCEND_MODULES
55 sxe_subdirs += modules
56 endif
57 sxe_subdirs += src lisp src lisp info etc tests
58
59 SUBDIRS =
60 SUBDIRS += $(sxe_subdirs)
61
62 m4datadir = $(datadir)/aclocal
63 dist_m4data_DATA = m4/sxemacs.m4 m4/sxe-pkgconfig.m4
64 dist_etc_DATA = PROBLEMS
65
66 pcdir = ${libdir}/pkgconfig
67 pc_DATA = sxemacs.pc
68
69 CLEANFILES = stage1 stage2 ,,build.done
70
71 ## custom rules
72 MV = mv
73 TOUCH = touch
74
75 RECURSE =                                                               \
76         @for subdir in $(sxe_subdirs); do                               \
77                 test "$$subdir" = . ||                                  \
78                         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@);    \
79         done ;                                                          \
80         @$(TOUCH) $@
81
82 CROSSMAKE = (cd `dirname $@` && $(MAKE) $(AM_MAKEFLAGS) `basename $@`)
83
84 if DESCEND_MODULES
85 module_DATA = modules/auto-autoloads.el modules/auto-autoloads.elc
86
87 modules/auto-autoloads.el \
88 modules/auto-autoloads.elc: $(EMACS)
89         $(CROSSMAKE)
90 endif
91
92 SXE_SHOW_DUMP = $(DESTDIR)$(bindir)/sxemacs -sd)
93
94 install-exec-hook:
95         mv -f $(DESTDIR)$(bindir)/sxemacs $(DESTDIR)$(bindir)/sxemacs-$(old_version)
96         (cd $(DESTDIR)$(bindir) && $(LN_S) sxemacs-$(old_version) sxemacs)
97
98 uninstall-hook:
99         cd $(DESTDIR)$(bindir) && \
100         $(RM) sxemacs-$(old_version)
101
102 check-recursive: all-recursive
103
104 $(ETAGS):
105         cd $(top_builddir)/lib-src 
106         $(MAKE) $(AM_MAKEFLAGS) etags
107
108 .PHONY: stage1 stage2 build-report time-build-report time-check beta
109 ## Convenience target for SXEmacs beta testers
110 beta: 
111         $(MAKE) $(RECURSIVE_MAKE_ARGS) clean
112         $(MAKE) $(RECURSIVE_MAKE_ARGS) all
113         @ touch ,,build.done
114
115 ## Convenience target for SXEmacs build reporters
116 env-report:
117         @(echo "Environment Variables" ;\
118           echo "---------------------"  ) | tee ,,vars.out
119         @(echo "${REPORT_VARS}" | \
120                 ${AWK} '{ for(f=1;f<=NF;f++) if( ENVIRON[$$f] ) \
121                         { print $$f "=" ENVIRON[$$f] } }') \
122                 | tee -a ,,vars.out
123         @(echo "Make Variables" ; \
124         echo "--------------" ; \
125         echo MAKE="${MAKE}" ; \
126         echo MAKEFILES="${MAKEFILES}" ; \
127         echo MAKEFLAGS="${MAKEFLAGS}" ; \
128         echo AM_MAKEFLAGS="${AM_MAKEFLAGS}" ;  \
129         echo RECURSIVE_MAKE_ARGS="${RECURSIVE_MAKE_ARGS}"  ) | tee -a ,,vars.out
130
131 time-beta:
132         (time $(MAKE) $(RECURSIVE_MAKE_ARGS) beta )2>&1 | tee ,,beta.out
133
134 time-all:
135         time $(MAKE) $(RECURSIVE_MAKE_ARGS) all
136
137 time-check:
138         (time $(MAKE) $(RECURSIVE_MAKE_ARGS) check ) 2>&1 | tee ,,make-check.out
139
140 build-report: env-report
141         $(MAKE) $(RECURSIVE_MAKE_ARGS) beta 2>&1 | tee ,,beta.out
142         @ [ -f ,,build.done ] || exit 1
143         $(MAKE) $(RECURSIVE_MAKE_ARGS) check 2>&1 | tee ,,make-check.out
144
145 time-build-report: env-report
146         (time $(MAKE) $(RECURSIVE_MAKE_ARGS) beta ) 2>&1 | tee ,,beta.out
147         @ [ -f ,,build.done ] || exit 1
148         (time $(MAKE) $(RECURSIVE_MAKE_ARGS) check ) 2>&1 | tee ,,make-check.out
149
150 stage1:
151         @echo
152         @echo "$@ in progress ..."
153         @$(RECURSE)
154         @echo "$@ finished"
155
156 stage2: stage1
157         @echo
158         @echo "$@ in progress ..."
159         @$(RECURSE)
160         @echo "$@ finished"
161
162 ### dont use staged build
163 ##all: stage1 stage2
164
165
166 distdir: dist-hook
167
168 dist-hook:
169         @echo "The dist targets do not work. Please read the sppm info section 'Making releases'."
170         @exit 1