summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/Makefile.in
blob: 38f30271fd81c149275b8eb520811229df5229f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Makefile for xdvik 
#
# - 1999/05/08: janl: Removed submakes for libwww and kpathsea.  That's what
#   the top makefile is for!
#

kpse_include ../make/paths.mk
kpse_include ../make/common.mk
kpse_include ../make/programs.mk
kpse_include ../make/cross.mk

all_subdirs = gui

CPP = @CPP@

# Make `#include <X11/...>' and `-lX...' work.
# This matches web2c (needed only for Metafont).
x_cppflags=@X_CFLAGS@ @iconv_includes@
x_ldflags=@X_LIBS@ @x_linker_options@ @iconv_libpath@
x_pre_libs=@X_PRE_LIBS@
x_extra_libs=@X_EXTRA_LIBS@ @iconv_libs@
x_tool_libs=@x_tool_libs@
x_xmu_lib=@x_xmu_lib@
x_xpm_libs=@x_xpm_libs@
# -lXp and -lXext
x_ext_lib=@x_ext_lib@

# Follow the library order used in X11R6 itself.
# It seems that on Cygwin, libXaw needs _XpmReadFileToPixmap, so we put
# x_xpm_libs after the tool_libs -- but before -lX11, since on MacOSX it
# uses XGrabServer and XUngrabServer, which would otherwise be
# unresolved with static libraries.
# Xmu needs to come before Xt and after the toolkit libs.
x_link = $(LDLIBT1) $(x_ldflags) $(x_tool_libs) $(x_xmu_lib) -lXt $(x_pre_libs) $(x_ext_lib) $(x_xpm_libs) -lX11 $(x_extra_libs)

LDLIBT1=@LDLIBT1@
LIBT1CPPFLAGS=@LIBT1CPPFLAGS@
LIBT1DEP=@LIBT1DEP@
LIBT1DIR = ../../libs/t1lib
LIBTYPE1DIR = $(LIBT1DIR)/../type1
LIBT1SRCDIR = $(srcdir)/$(LIBT1DIR)

# various xdvik GUI elements
LIBGUI=./gui/libgui.a
LIBGUIDEP=$(LIBGUI)


# Extra xdvi-specific compiler options.
# ps_def = @PS_DEF@ -DXSERVER_INFO -DNEW_MENU_CREATION
# ps_def = @PS_DEF@ -DRGB_ANTI_ALIASING
ps_def = @PS_DEF@
prog_cflags = @XTRA_WARN_CFLAGS@ $(LIBT1CPPFLAGS) $(ps_def) \
-I$(srcdir)/gui -I../../libs/t1lib/lib/t1lib -I../kpathsea $(x_cppflags)

# Note: to be able to use one depend.mk file for both Motif/Xaw (which
# is needed since only maintainers are supposed to invoke `make depend')
# we include *all* object files and have tests for #ifdef MOTIF/XAW inside
# the files.
objects = \
    browser.o \
    dvi-draw.o \
    dvi-init.o \
    dvisel.o \
    encodings.o \
    events.o \
    filehist.o \
    font-open.o \
    gf.o \
    hypertex.o \
    image-magick.o \
    mime.o \
    my-snprintf.o \
    my-vsnprintf.o \
    pagehist.o \
    pk.o \
    print-internal.o \
    psdps.o \
    psgs.o \
    psheader.o \
    psnews.o \
    read-mapfile.o \
    search-internal.o \
    special.o \
    string-utils.o \
    tfmload.o \
    util.o \
    vf.o \
    xdvi.o \
    xserver-info.o \
    x_util.o

# t1mapper or its man page are currently not being installed, since they
# aren't needed on most current (teTeX) systems
perlprog = t1mapper
manpage = xdvi

default all: libguibuild @final_exec_name@ $(manpage).1

$(LIBGUI):
	cd gui; $(MAKE) $(makeargs) libgui.a

### we need this additional target so that libgui is always checked to be up-to-date ...
libguibuild:
	cd gui; $(MAKE) $(makeargs) libgui.a

@final_exec_name@: $(kpathsea) $(objects) $(LIBT1DEP) $(LIBGUIDEP)
	$(kpathsea_link) $(objects) $(LIBGUI) $(x_link) $(LOADLIBES)

squeeze.o: squeeze.c
	$(build_compile) -c $<
squeeze: squeeze.o
	$(build_link_command) squeeze.o

psheader.c: psheader.txt squeeze
	./squeeze $(srcdir)/psheader.txt $@

$(manpage).1: xdvi.1.in sedscript
	sed -f sedscript <$(srcdir)/xdvi.1.in >$@

sedscript: mksedscript c-auto.h
	$(SHELL) $(srcdir)/mksedscript $(srcdir) pkpath sizes vfpath \
	figpath headerpath $(DEFS) $(prog_cflags) >$@

install: install-exec install-data
uninstall: uninstall-exec uninstall-data

install-exec: @final_exec_name@
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
	$(INSTALL_LIBTOOL_PROG) @final_exec_name@ $(bindir)
	$(INSTALL_SCRIPT) xdvi-sh $(scriptdir)/@wrapper_script@
	rm -f $(scriptdir)/o@wrapper_script@
	ln -s @wrapper_script@ $(scriptdir)/o@wrapper_script@
### fix wrong CVS permissions for shell script
	$(INSTALL_SCRIPT) $(srcdir)/xdvizilla $(scriptdir)/xdvizilla
	chmod +x $(scriptdir)/xdvizilla

uninstall-exec:
	for p in @final_exec_name@; do rm -f $(bindir)/$$p; done
	for p in @wrapper_script@ o@wrapper_script@; do rm -f $(scriptdir)/$$p; done

install-data: $(manpage).1 pixmaps/toolbar.xpm pixmaps/toolbar2.xpm
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir) 
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf)/xdvi/pixmaps
	$(INSTALL_DATA) $(manpage).1 $(man1dir)/$(manpage).$(manext)
	rm -f $(man1dir)/o$(manpage).$(manext)
	ln -s $(manpage).$(manext) $(man1dir)/o$(manpage).$(manext)
	$(INSTALL_DATA) $(srcdir)/texmf/XDvi $(texmf)/xdvi/XDvi
	$(INSTALL_DATA) $(srcdir)/pixmaps/toolbar.xpm $(srcdir)/pixmaps/toolbar2.xpm $(texmf)/xdvi/pixmaps
	if \
	    grep 'original xdvi.cfg --' $(texmf)/xdvi/xdvi.cfg >/dev/null 2>&1 \
	    || test ! -r $(texmf)/xdvi/xdvi.cfg; \
	then \
	    $(INSTALL_DATA) $(srcdir)/texmf/xdvi.cfg $(texmf)/xdvi/xdvi.cfg; \
	else \
	    true; \
	fi
	$(INSTALL_DATA) $(srcdir)/xdvizilla.1 $(man1dir)/xdvizilla.$(manext)

uninstall-data:
	rm -f $(man1dir)/$(manpage).$(manext) $(man1dir)/xdvizilla.$(manext) \
		$(scriptdir)/xdvizilla \
		$(texmf)/xdvi/pixmaps/toolbar.xpm $(texmf)/xdvi/pixmaps/toolbar2.xpm \
		$(texmf)/xdvi/XDvi
	if \
	    head -n 1 $(texmf)/xdvi/xdvi.cfg | grep 'original xdvi.cfg --' >/dev/null 2>&1 \
	    || test ! -r $(texmf)/xdvi/xdvi.cfg; \
	then \
	    rm -f $(texmf)/xdvi/xdvi.cfg; \
		else \
	    true; \
	fi
	rmdir $(texmf)/xdvi/pixmaps

distname = xdvik
program_files = *.1.in *.ac xdvi.icon xdvi.FAQ psheader.txt mksedscript \
  MOTIF
version_files = xdvi.c

pre-dist-$(distname):
post-dist-$(distname):
	cd $(top_distdir); rm -f xdvik/psheader.c

kpse_include ../make/dist.mk
kpse_include ../make/config.mk

info dvi check:

kpse_include ../make/clean.mk

mostlyclean::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
clean::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
distclean::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
extraclean::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
maintainer-clean::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done

depend::
	test ! -r gui/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done

clean::
	rm -f $(manpage).1 *.flc @final_exec_name@

distclean::
	rm -f psheader.c krheader.h sedscript $(manpage).1 *.flc *~ @final_exec_name@ xdvi-sh
	test -f $(LIBTYPE1DIR)/Makefile && { cd $(LIBTYPE1DIR); $(MAKE) distclean; } || true
	test -f $(LIBT1DIR)/Makefile && { cd $(LIBT1DIR); $(MAKE) distclean; } || true

$(LIBT1DIR)/libt1.a:
	cd $(LIBT1DIR); $(MAKE) $(makeargs) libt1.a

$(LIBTYPE1DIR)/libtype1.a:
	cd $(LIBTYPE1DIR); $(MAKE) $(makeargs) libtype1.a


kpse_include ../make/tkpathsea.mk
kpse_include ../make/rdepend.mk
kpse_include depend.mk