2 ###############################################################################
3 # MODULE : main TeXmacs make file
4 # COPYRIGHT : (C) 1999-2008 Joris van der Hoeven
5 ###############################################################################
6 # This software falls under the GNU general public license version 3 or later.
7 # It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
8 # in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
9 ###############################################################################
12 exec_prefix = @
exec_prefix@
13 includedir = @
includedir@
16 datarootdir
= @datarootdir@
32 CHMOD
= @CONFIG_CHMOD@
34 STRIP
= @CONFIG_STRIP@
37 ###############################################################################
39 ###############################################################################
42 cd src
; $(MAKE
) -f makefile link
=shared
43 $(MAKE
) -f Makefile PLUGINS
44 $(MAKE
) -f Makefile EX_PLUGINS
45 $(CP
) misc
/scripts
/fig2ps
$(tmdir
)/bin
46 $(CP
) misc
/scripts
/texmacs
$(tmdir
)/bin
47 $(CP
) misc
/scripts
/tm_gs
$(tmdir
)/bin
48 $(CHMOD
) 755 $(tmdir
)/bin
/*
49 $(CHMOD
) 755 plugins
/*/bin
/*
50 $(RM
) -r
$(tmdir
)/plugins
51 $(CP
) plugins
$(tmdir
)/plugins
52 @echo
----------------------------------------------------
53 @echo dynamic TeXmacs has been successfully compiled
55 STATIC_TEXMACS
: EMPTY_DIRS
56 cd src
; $(MAKE
) -f makefile link
=static
57 $(MAKE
) -f Makefile PLUGINS
58 $(MAKE
) -f Makefile EX_PLUGINS
59 $(CP
) misc
/scripts
/fig2ps
$(tmdir
)/bin
60 $(CP
) misc
/scripts
/texmacs
$(tmdir
)/bin
61 $(CP
) misc
/scripts
/tm_gs
$(tmdir
)/bin
62 $(CHMOD
) 755 $(tmdir
)/bin
/*
63 $(CHMOD
) 755 plugins
/*/bin
/*
64 $(RM
) -r
$(tmdir
)/plugins
65 $(CP
) plugins
$(tmdir
)/plugins
66 @echo
----------------------------------------------------
67 @echo static TeXmacs has been successfully compiled
70 cd src
; $(MAKE
) -f makefile deps
78 .PHONY
: TEXMACS STATIC_TEXMACS DEPS EXPERIMENTAL
86 .PHONY
: deps
install uninstall clean distclean
88 ###############################################################################
90 ###############################################################################
92 PLUGINS_ALL
:= $(wildcard plugins
/*)
93 PLUGINS_MAKEFILE
:= $(wildcard plugins
/*/Makefile
)
94 PLUGINS_COMPILE
:= $(patsubst %Makefile
,%COMPILE
,$(PLUGINS_MAKEFILE
))
95 PLUGINS_CLEAN
:= $(patsubst %Makefile
,%CLEAN
,$(PLUGINS_MAKEFILE
))
98 $(MKDIR
) plugins
/$*/bin
99 cd plugins
/$*; $(MAKE
) -i
-f Makefile CC
="@CC@" CXX
="@CXX@"
102 cd plugins
/$*; $(MAKE
) -i
-f Makefile
clean
104 PLUGINS
: $(PLUGINS_COMPILE
)
106 CLEAN_PLUGINS
: $(PLUGINS_CLEAN
)
108 .PHONY
: PLUGINS CLEAN_PLUGINS
110 EX_PLUGINS_PRG
:= $(wildcard TeXmacs
/examples
/plugins
/*/progs
)
111 EX_PLUGINS_BIN
:= $(patsubst %/progs
,%/bin
,$(EX_PLUGINS_PRG
))
113 TeXmacs
/examples
/plugins
/%/bin
:
114 $(MKDIR
) TeXmacs
/examples
/plugins
/$*/bin
116 EX_PLUGINS
: $(EX_PLUGINS_BIN
)
117 $(MKDIR
) TeXmacs
/examples
/plugins
/dynlink
/lib
121 ###############################################################################
122 # Installing and removing TeXmacs (for system administrators)
123 ###############################################################################
126 $(MKDIR
) $(DESTDIR
)$(tmbin
)
127 $(MKDIR
) $(DESTDIR
)$(tmbin
)/bin
128 $(MKDIR
) $(DESTDIR
)$(tmbin
)/lib
129 $(CP
) $(tmdir
)/bin
/texmacs.bin
$(DESTDIR
)$(tmbin
)/bin
130 $(CP
) $(tmdir
)/bin
/tm_gs
$(DESTDIR
)$(tmbin
)/bin
131 $(CP
) $(tmdir
)/plugins
/*/bin
/* $(DESTDIR
)$(tmbin
)/bin
132 $(CP
) $(tmdir
)/plugins
/*/lib
/*.
$(so
) $(DESTDIR
)$(tmbin
)/lib
2>/dev
/null ||
:
133 $(STRIP
) $(DESTDIR
)$(tmbin
)/bin
/texmacs.bin
134 $(CP
) $(tmdir
)/lib
/*.
$(so
) $(DESTDIR
)$(tmbin
)/lib
2>/dev
/null ||
:
135 $(STRIP
) $(DESTDIR
)$(tmbin
)/lib
/*.
$(so
) 2>/dev
/null ||
:
136 $(CHMOD
) 755 $(DESTDIR
)$(tmbin
)/bin
/*
137 $(CHMOD
) 755 $(DESTDIR
)$(tmbin
)/lib
/*.
$(so
) 2>/dev
/null ||
:
138 $(RM
) $(DESTDIR
)$(tmbin
)/lib
/*.a
139 @echo installed TeXmacs executables in
$(DESTDIR
)$(tmbin
)
140 $(MKDIR
) $(DESTDIR
)$(tmdata
)
141 $(CP
) $(tmdir
)/LICENSE
$(DESTDIR
)$(tmdata
)
142 $(CP
) $(tmdir
)/doc
$(DESTDIR
)$(tmdata
)
143 $(CP
) $(tmdir
)/examples
$(DESTDIR
)$(tmdata
)
144 $(CP
) $(tmdir
)/fonts
$(DESTDIR
)$(tmdata
)
145 $(CP
) $(tmdir
)/langs
$(DESTDIR
)$(tmdata
)
146 $(CP
) $(tmdir
)/misc
$(DESTDIR
)$(tmdata
)
147 $(CP
) $(tmdir
)/packages
$(DESTDIR
)$(tmdata
)
148 $(CP
) $(tmdir
)/progs
$(DESTDIR
)$(tmdata
)
149 $(CP
) $(tmdir
)/styles
$(DESTDIR
)$(tmdata
)
150 $(CP
) $(tmdir
)/texts
$(DESTDIR
)$(tmdata
)
151 $(CHMOD
) -R go
=rX
$(DESTDIR
)$(tmdata
)
152 @echo installed TeXmacs data in
$(DESTDIR
)$(tmdata
)
153 $(CP
) plugins
$(DESTDIR
)$(tmdata
)
154 $(RM
) $(DESTDIR
)$(tmdata
)/plugins
/*/Makefile
155 $(RM
) -r
$(DESTDIR
)$(tmdata
)/plugins
/*/src
156 $(RM
) -r
$(DESTDIR
)$(tmdata
)/plugins
/*/bin
157 $(RM
) -r
$(DESTDIR
)$(tmdata
)/plugins
/*/lib
158 @echo installed TeXmacs plugins data in
$(DESTDIR
)$(tmdata
)/plugins
159 $(MKDIR
) $(DESTDIR
)$(bindir)
160 $(CHMOD
) 755 $(tmdir
)/bin
/*
161 $(CP
) $(tmdir
)/bin
/fig2ps
$(DESTDIR
)$(bindir)
162 $(CP
) $(tmdir
)/bin
/texmacs
$(DESTDIR
)$(bindir)
163 @echo installed TeXmacs startup scripts in
$(DESTDIR
)$(bindir)
164 $(MKDIR
) $(DESTDIR
)$(includedir)
165 $(CP
) $(tmdir
)/include/TeXmacs.h
$(DESTDIR
)$(includedir)
166 $(CHMOD
) go
=rX
$(DESTDIR
)$(includedir)/TeXmacs.h
167 @echo installed TeXmacs
include files in
$(DESTDIR
)$(includedir)
168 $(MKDIR
) $(DESTDIR
)$(mandir)
169 $(MKDIR
) $(DESTDIR
)$(mandir)/man1
170 $(CP
) misc
/man
/fig2ps
.1 $(DESTDIR
)$(mandir)/man1
171 $(CP
) misc
/man
/texmacs
.1 $(DESTDIR
)$(mandir)/man1
172 $(GZIP
) $(DESTDIR
)$(mandir)/man1
/fig2ps
.1
173 $(GZIP
) $(DESTDIR
)$(mandir)/man1
/texmacs
.1
174 $(CHMOD
) go
=rX
$(DESTDIR
)$(mandir)/man1
/fig2ps
.1.gz
175 $(CHMOD
) go
=rX
$(DESTDIR
)$(mandir)/man1
/texmacs
.1.gz
176 @echo installed TeXmacs manual pages in
$(DESTDIR
)$(mandir)
177 @echo
----------------------------------------------------
178 @echo TeXmacs has been successfully installed
182 @echo removed TeXmacs executables from
$(tmbin
)
184 @echo removed TeXmacs data from
$(tmdata
)
185 $(RM
) $(includedir)/TeXmacs.h
186 @echo removed TeXmacs
include files from
$(includedir)
187 $(RM
) $(bindir)/fig2ps
188 $(RM
) $(bindir)/texmacs
189 @echo removed TeXmacs startup scripts from
$(bindir)
190 $(RM
) $(mandir)/man1
/fig2ps
.1.gz
191 $(RM
) $(mandir)/man1
/texmacs
.1.gz
192 @echo removed TeXmacs manual pages from
$(mandir)
193 @echo
----------------------------------------------------
194 @echo TeXmacs has been successfully removed
196 .PHONY
: INSTALL UNINSTALL
198 ###############################################################################
199 # Make a bundle for Mac OS X
200 ###############################################################################
202 BUNDLE_SRC
= misc
/bundle
203 BUNDLE_APP
= ..
/distr
/TeXmacs.app
204 BUNDLE_DMG
= ..
/distr
/TeXmacs.dmg
205 BUNDLE_CONTENTS
= $(BUNDLE_APP
)/Contents
206 BUNDLE_RESOURCES
= $(BUNDLE_CONTENTS
)/Resources
207 BUNDLE_TEXMACS
= $(BUNDLE_RESOURCES
)/share
/TeXmacs
208 BUNDLE_FONTS
= TeXmacs-windows-fonts-1.0
-noarch.
tar.gz
212 $(RM
) -r
$(BUNDLE_APP
)
213 $(MKDIR
) $(BUNDLE_APP
)
214 $(MKDIR
) $(BUNDLE_CONTENTS
)
215 $(CP
) $(BUNDLE_SRC
)/Info.plist
$(BUNDLE_CONTENTS
)
216 $(CP
) $(BUNDLE_SRC
)/PkgInfo
$(BUNDLE_CONTENTS
)
217 $(MKDIR
) $(BUNDLE_CONTENTS
)/MacOS
218 $(CP
) TeXmacs
/bin
/texmacs.bin
$(BUNDLE_CONTENTS
)/MacOS
/TeXmacs
219 $(MKDIR
) $(BUNDLE_RESOURCES
)
220 $(CP
) $(BUNDLE_SRC
)/TeXmacs.icns
$(BUNDLE_RESOURCES
)
221 $(CP
) $(BUNDLE_SRC
)/TeXmacs-document.icns
$(BUNDLE_RESOURCES
)
222 $(CP
) src
/Plugins
/Cocoa
/English.lproj
$(BUNDLE_RESOURCES
)
223 $(MKDIR
) $(BUNDLE_RESOURCES
)/bin
224 $(MKDIR
) $(BUNDLE_RESOURCES
)/lib
225 $(MKDIR
) $(BUNDLE_RESOURCES
)/share
226 $(CP
) TeXmacs
$(BUNDLE_RESOURCES
)/share
227 $(RM
) $(BUNDLE_TEXMACS
)/bin
/texmacs.bin
228 $(RM
) -r
$(BUNDLE_TEXMACS
)/doc
229 if
[ -f ..
/doc
] ; then \
230 $(CP
) ..
/doc
$(BUNDLE_TEXMACS
) ;\
232 GUILE_DATA_PATH
=`guile-config info pkgdatadir`; \
233 export GUILE_DATA_PATH
; \
234 GUILE_LOAD_PATH
=`find $$GUILE_DATA_PATH -type d | grep ice-9`; \
235 export GUILE_LOAD_PATH
; \
236 $(CP
) $$GUILE_LOAD_PATH $(BUNDLE_TEXMACS
)/progs
/
237 $(CHMOD
) 644 $(BUNDLE_TEXMACS
)/progs
/ice-9
/*
238 $(CHMOD
) 755 $(BUNDLE_TEXMACS
)/progs
/ice-9
239 $(CHMOD
) 755 $(BUNDLE_TEXMACS
)/progs
/ice-9
/debugger
2>/dev
/null ||
:
240 if
[ -f ..
/distr
/$(BUNDLE_FONTS
) ] ; then \
241 $(CP
) ..
/distr
/$(BUNDLE_FONTS
) $(BUNDLE_TEXMACS
) ; \
242 cd
$(BUNDLE_TEXMACS
) ; \
243 tar -zxf
$(BUNDLE_FONTS
); \
244 $(RM
) $(BUNDLE_FONTS
) ; \
246 # $(CP) /opt/local/bin/gs $(BUNDLE_RESOURCES)/bin
247 # $(CP) /opt/local/bin/ps2pdf $(BUNDLE_RESOURCES)/bin
248 # cp -R -f /opt/local/share/ghostscript $(BUNDLE_RESOURCES)/share
249 $(RM
) -r
$(BUNDLE_TEXMACS
)/CVS
250 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/CVS
251 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/CVS
252 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/CVS
253 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/CVS
254 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/CVS
255 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/*/CVS
256 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/*/*/CVS
257 $(RM
) -r
$(BUNDLE_TEXMACS
)/.svn
258 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/.svn
259 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/.svn
260 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/.svn
261 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/.svn
262 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/.svn
263 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/*/.svn
264 $(RM
) -r
$(BUNDLE_TEXMACS
)/*/*/*/*/*/*/*/.svn
266 define bundle_install_lib
267 $(CP
) $(1) $(BUNDLE_RESOURCES
)/lib
268 install_name_tool
-change
$(1) @executable_path
/..
/Resources
/lib
/$(2) $(BUNDLE_CONTENTS
)/MacOS
/texmacs.bin
269 install_name_tool
-id @executable_path
/..
/Resources
/lib
/$(2) $(BUNDLE_RESOURCES
)/lib
/$(2)
272 bundle_libraries
= $(shell otool
-L
$(BUNDLE_CONTENTS
)/MacOS
/texmacs.bin | grep
-o
'/\(opt\|sw\|Users\)/.*/lib[^/]*dylib')
275 $(foreach lib
, $(bundle_libraries
), $(call bundle_install_lib
,$(lib
),$(notdir $(lib
))) ;)
277 #BUNDLE: BUNDLE_MAIN BUNDLE_LIBS
279 $(BUNDLE_SRC
)/bundle-libs.sh
$(BUNDLE_CONTENTS
)/MacOS
/TeXmacs
284 hdiutil create
-srcfolder
$(BUNDLE_APP
) $(BUNDLE_DMG
)
285 $(RM
) -r
$(BUNDLE_APP
)
289 ###############################################################################
290 # Make a bundle for Windows
291 ###############################################################################
293 WIN_BUNDLE_SRC
= misc
/windows
294 WIN_BUNDLE_DIR
= ..
/distr
/TeXmacs-Windows
295 WIN_BUNDLE_BIN_DIR
= $(WIN_BUNDLE_DIR
)/bin
296 WIN_BUNDLE_FONTS
= TeXmacs-windows-fonts-1.0
-noarch.
tar.gz
298 ## WARNING: the following path list needs to be adapted manually
301 DLLS_IN_PATH
= $(wildcard $(addsuffix /$(1),$(subst :, ,$(DLLPATH
))))
302 DLL_LIST
= QtCore4.dll QtGui4.dll QtSvg4.dll mingwm10.dll libgmp
*.dll libguile
*.dll libfreetype
*.dll libltdl
*.dll libiconv
*.dll
303 DLLS
= $(foreach DLL
,$(DLL_LIST
),$(call DLLS_IN_PATH
,$(DLL
)))
305 WIN_BUNDLE_MAIN
: TEXMACS
307 $(RM
) -r
$(WIN_BUNDLE_DIR
)
308 $(MKDIR
) $(WIN_BUNDLE_DIR
)
309 $(CP
) TeXmacs
/* $(WIN_BUNDLE_DIR
)/.
310 $(MV
) $(WIN_BUNDLE_DIR
)/bin
/texmacs.bin
$(WIN_BUNDLE_DIR
)/bin
/texmacs.exe
311 $(RM
) -r
$(WIN_BUNDLE_DIR
)/bin
/texmacs
312 $(RM
) -r
$(WIN_BUNDLE_DIR
)/doc
313 $(CP
) ..
/doc
$(WIN_BUNDLE_DIR
)
314 GUILE_DATA_PATH
=`guile-config info pkgdatadir`; \
315 export GUILE_DATA_PATH
; \
316 GUILE_LOAD_PATH
=`find $$GUILE_DATA_PATH -type d | grep ice-9`; \
317 export GUILE_LOAD_PATH
; \
318 for I in
$$GUILE_LOAD_PATH ; do
$(CP
) $$I $(WIN_BUNDLE_DIR
)/progs
/ ; done
319 find
$(WIN_BUNDLE_DIR
)/progs
/ice-9
-type f
-exec
$(CHMOD
) 644 {} \
;
320 if
[ -f ..
/distr
/$(BUNDLE_FONTS
) ] ; then \
321 $(CP
) ..
/distr
/$(BUNDLE_FONTS
) $(WIN_BUNDLE_DIR
) ; \
322 cd
$(WIN_BUNDLE_DIR
) ; \
323 tar -zxf
$(BUNDLE_FONTS
); \
324 $(RM
) $(BUNDLE_FONTS
) ; \
326 # $(CP) /opt/local/bin/gs $(BUNDLE_RESOURCES)/bin
327 # $(CP) /opt/local/bin/ps2pdf $(BUNDLE_RESOURCES)/bin
328 # cp -R -f /opt/local/share/ghostscript $(BUNDLE_RESOURCES)/share
329 $(RM
) -r
$(WIN_BUNDLE_DIR
)/.svn
330 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/.svn
331 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/.svn
332 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/*/.svn
333 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/*/*/.svn
334 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/*/*/*/.svn
335 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/*/*/*/*/.svn
336 $(RM
) -r
$(WIN_BUNDLE_DIR
)/*/*/*/*/*/*/*/.svn
340 for DLL in
$(DLLS
) ; do
$(CP
) $$DLL $(WIN_BUNDLE_BIN_DIR
) ; done
343 WIN_BUNDLE
: WIN_BUNDLE_MAIN WIN_BUNDLE_LIBS
347 ###############################################################################
348 # Cleaning and backups
349 ###############################################################################
352 $(RM
) -r
$(tmdir
)/doc
/examples
353 $(RM
) -r
$(tmdir
)/doc
/images
354 $(RM
) -r
$(tmdir
)/doc
/tutorial
355 $(RM
) -r
$(tmdir
)/doc
/web
356 $(RM
) -r
$(tmdir
)/doc
/plugins
357 $(RM
) -r
$(tmdir
)/doc
/CVS
358 $(RM
) -r
$(tmdir
)/doc
/*/CVS
359 $(RM
) -r
$(tmdir
)/doc
/*/*/CVS
360 $(RM
) -r
$(tmdir
)/doc
/*/*/*/CVS
361 $(RM
) -r
$(tmdir
)/doc
/*/*/*/*/CVS
362 $(RM
) -r
$(tmdir
)/doc
/.svn
363 $(RM
) -r
$(tmdir
)/doc
/*/.svn
364 $(RM
) -r
$(tmdir
)/doc
/*/*/.svn
365 $(RM
) -r
$(tmdir
)/doc
/*/*/*/.svn
366 $(RM
) -r
$(tmdir
)/doc
/*/*/*/*/.svn
369 $(RM
) $(tmdir
)/TEX_PATHS
383 $(RM
) plugins
/*/*/core
384 $(RM
) $(tmdir
)/lib
/*.a
385 $(RM
) $(tmdir
)/fonts
/error
/* 2>/dev
/null ||
:
386 $(RM
) -r autom
*.cache
389 cd src
; $(MAKE
) -f makefile DISTR
392 $(RM
) $(tmdir
)/examples
/plugins
/bin
/* 2>/dev
/null ||
:
393 $(RM
) $(tmdir
)/plugins
394 $(RM
) $(tmdir
)/lib
/* 2>/dev
/null ||
:
395 $(RM
) $(tmdir
)/bin
/* 2>/dev
/null ||
:
396 $(RM
) -r
$(tmdir
)/misc
/images
/.xvpics
397 $(RM
) -r
$(tmdir
)/progs
/ice-9
401 cd src
; $(MAKE
) -f makefile CLEAN
403 CLEAN
: SCLEAN RCLEAN CLEAN_PLUGINS
406 $(RM
) src
/Objects
/* 2>/dev
/null ||
:
407 $(RM
) misc
/doxygen
/Doxyfile
408 $(RM
) misc
/man
/texmacs
.1
409 $(RM
) misc
/scripts
/fig2ps
410 $(RM
) misc
/scripts
/texmacs
411 $(RM
) src
/System
/config.h
412 $(RM
) src
/System
/tm_configure.hpp
414 $(RM
) TeXmacs
/examples
/plugins
/dynlink
/Makefile
420 .PHONY
: RDISTR DISTR RCLEAN SCLEAN DISTCLEAN
422 ###############################################################################
423 # Miscellaneous targets
424 ###############################################################################
433 $(TOUCH
) */*/*/*/*.
cpp
436 $(STRIP
) $(tmdir
)/bin
/texmacs.bin
437 $(STRIP
) $(tmdir
)/lib
/*.
$(so
) 2>/dev
/null ||
>/dev
/null
438 $(STRIP
) $(tmdir
)/plugins
/*/bin
/* 2>/dev
/null ||
>/dev
/null
442 $(CHMOD
) -R go
+x
$(tmdir
)/bin
443 $(CHMOD
) -R go
+x
$(tmdir
)/lib
445 .PHONY
: TOUCH STRIP ACCESS_FLAGS