summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/Makefile.in.work
blob: ebe2efcbe404387c21d71c3791232d77d933a3d8 (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
# @configure_input@
# Makefile for xdvik 
#

kpse_include ../make/paths.mk
kpse_include ../make/common.mk
### hack to prevent linking with kpathsea by default
kpathsea=
kpse_include ../make/programs.mk
kpse_include ../make/cross.mk

all_subdirs = gui tests

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@

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

# additional flags for kpathsea
LDLIBKPATHSEA=@LDLIBKPATHSEA@
LIBKPATHSEACPPFLAGS=@LIBKPATHSEACPPFLAGS@
LIBKPATHSEADEP=@LIBKPATHSEADEP@

# 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) $(LDLIBKPATHSEA) $(x_ldflags) $(x_tool_libs) $(x_xmu_lib) -lXt $(x_pre_libs) $(x_ext_lib) $(x_xpm_libs) -lX11 $(x_extra_libs)

TESTS=./tests/run_tests
TESTS_DEP=$(TESTS)

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


# Extra xdvi-specific compiler options.
# xdvi_defs = @PS_DEF@ -DXSERVER_INFO -DNEW_MENU_CREATION
# xdvi_defs = @PS_DEF@ -DRGB_ANTI_ALIASING
xdvi_defs = @PS_DEF@ -DXDVI_KPSE_PROG_NAME=@wrapper_script@
prog_cflags = @XTRA_WARN_CFLAGS@ $(LIBT1CPPFLAGS) $(LIBKPATHSEACPPFLAGS) $(xdvi_defs) \
-I$(srcdir)/gui $(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 \
    dl_list.o \
    dvi-draw.o \
    dvi-init.o \
    dvisel.o \
    encodings.o \
    events.o \
    exit-handlers.o \
    filehist.o \
    font-open.o \
    gf.o \
    string_list.o \
    hypertex.o \
    image-magick.o \
    main.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

$(TESTS):
	cd tests; $(MAKE) $(makeargs)

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

test:
	cd tests; $(MAKE) $(makeargs) test

test_verbose:
	cd tests; $(MAKE) $(makeargs) test_verbose

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

$(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@

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
	$(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)

uninstall-data:
	rm -f $(man1dir)/$(manpage).$(manext)

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


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

distclean::
	rm -f psheader.c sedscript $(manpage).1 *.flc *~ @final_exec_name@ xdvi-sh