summaryrefslogtreecommitdiff
path: root/tools/gslite/gslt_lib_msvc.mak
blob: 54d91bd11c6aef53f0630d52cc723586a4ed3161 (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
# gslite library makefile.

MAKEFILE=gslt_lib_msvc.mak
MSVC_VERSION=8

# Debugging options.  For production system DEBUG=0 and TDEBUG=0.
DEBUG=1
TDEBUG=1

DEVSTUDIO=
NOPRIVATE=0

COMPILE_INITS=0


# this is where we build everything.  The ghostscript makefiles will
# need all of these set to work properly.
GENDIR=.\obj
GLGENDIR=.\obj
GLOBJDIR=.\obj

# location of ghostscript source code.
GLSRCDIR=..\..\gs\src

# sigh.  will we ever fix this?  Definitions to force gx_color_index
# to 64 bits and define GSLITE.

XCFLAGS=/DGSLITE

DD=$(GLGENDIR)

# output devices - none required.
DEVICES=

# required features in addition to libcore.dev.  NB This should be
# pruned.
FEATURES=\
	$(DD)\page.dev $(DD)\gsnogc.dev $(DD)\ttflib.dev $(DD)\sdctd.dev\
	$(DD)\psf1lib.dev $(DD)\psf2lib.dev\
	$(DD)\path1lib.dev $(DD)\shadelib.dev $(DD)\cidlib.dev\
	$(DD)\psl3lib.dev $(DD)\slzwd.dev $(DD)\szlibd.dev\
	$(DD)\cmaplib.dev $(DD)\libpng.dev

# jpeg
JSRCDIR=..\..\gs\jpeg
JGENDIR=$(GENDIR)
JOBJDIR=$(GENDIR)

# zlib
ZSRCDIR=..\..\gs\zlib
ZGENDIR=$(GENDIR)
ZOBJDIR=$(GENDIR)

# lib png
PNGSRCDIR=..\..\gs\libpng
PNGGENDIR=$(GENDIR)
PNGOBJDIR=$(GENDIR)

# indicate we do not want use system shared libraries for zlib, png,
# and jpeg.
SHARE_ZLIB=0
SHARE_LIBPNG=0
SHARE_JPEG=0

STDLIBS=-lm

GSLITE_LIB=libgslt.dll
all: $(GSLITE_LIB)

# invoke the gs *library* makefile to build needed
# devices, objects and configuration files.
GSLIB_PARTS=$(GLOBJDIR)\ld.tr
$(GSLIB_PARTS): $(MAKEFILE) 
	-mkdir $(GLOBJDIR)
	$(MAKE) \
	  DEBUG=$(DEBUG) \
	  TDEBUG=$(TDEBUG) \
	  MSVC_VERSION=$(MSVC_VERSION) \
	  DEVSTUDIO=$(DEVSTUDIO) \
	  GCFLAGS=$(GCFLAGS) \
	  XCFLAGS=$(XCFLAGS) \
	  STDLIBS=$(STDLIBS) \
	  FEATURE_DEVS="$(FEATURES)"\
          DEVICE_DEVS="$(DEVICES)"\
	  GLSRCDIR=$(GLSRCDIR) GLGENDIR=$(GLGENDIR) GLOBJDIR=$(GLOBJDIR) \
	  JSRCDIR=$(JSRCDIR) JGENDIR=$(JGENDIR) JOBJDIR=$(JOBJDIR)\
	  ZSRCDIR=$(ZSRCDIR) ZGENDIR=$(ZGENDIR) ZOBJDIR=$(ZOBJDIR)\
	  PNGSRCDIR=$(PNGSRCDIR) PNGGENDIR=$(PNGGENDIR) PNGOBJDIR=$(PNGOBJDIR)\
	  PSD="$(GENDIR)/"\
	  SHARE_ZLIB=$(SHARE_ZLIB) SHARE_LIBPNG=$(SHARE_LIBPNG) SHARE_JPEG=$(SHARE_JPEG)\
	  /f $(GLSRCDIR)\msvclib.mak \
	  $(GLOBJDIR)\ld.tr \
	  $(GLOBJDIR)\gsargs.obj \
	  $(GLOBJDIR)\gconfig.obj $(GLOBJDIR)\gscdefs.obj \
	  $(GLOBJDIR)\jpeglib_.h


# ---------------------------------
# settings needed for building the gslite objects of gslt.mak

GSLTSRCDIR=.


# common definitions - CC_, I_ etc.
COMMONDIR=..\..\common
!include $(COMMONDIR)\pcdefs.mak
!include $(COMMONDIR)\msvcdefs.mak
!include $(GLSRCDIR)\msvccmd.mak

# include for gslt sources
!include gslt.mak

# ---------------------------------
# put gslite and graphics library objects in one library



# windows clutter.
MSXLIBS=shell32.lib comdlg32.lib gdi32.lib user32.lib winspool.lib advapi32.lib
# gs library config and miscellany.
GSXLIBS=$(GLOBJDIR)\gsargs.obj $(GLOBJDIR)\gconfig.obj $(GLOBJDIR)\gscdefs.obj

$(GSLITE_LIB): $(GSLIB_PARTS) $(GSLT_OBJS) $(GSXLIBS) $(MAKEFILE)
	link -dll -out:$(GSLITE_LIB) -def:gslt.def \
	-implib:gsltimp.lib $(GSLT_OBJS) $(MSXLIBS) $(GSXLIBS) @obj\ld.tr 

# the dependency on GSLIB_LIB is needed because the c compiler line
# @ccf32.tr is a needed side effect from building the library.
$(GSLTOBJ)gslt_image_test.$(OBJ) : $(GSLITE_LIB) $(GSLTSRC)gslt_image_test.c
	$(GSLT_CC) $(GSLTO_)gslt_image_test.$(OBJ) $(C_) $(GSLTSRC)gslt_image_test.c

$(GSLTOBJ)gslt_font_test.$(OBJ) : $(GSLITE_LIB) $(GSLTSRC)gslt_font_test.c
	$(GSLT_CC) $(GSLTO_)gslt_font_test.$(OBJ) $(C_) $(GSLTSRC)gslt_font_test.c

gslt_image_test.exe: $(GSLTOBJ)gslt_image_test.$(OBJ) $(GSLT_OBJS) $(GSLITE_LIB)
	link $(GSLTOBJ)gslt_image_test.$(OBJ) gsltimp.lib

gslt_font_test.exe: $(GSLTOBJ)gslt_font_test.$(OBJ) $(GSLT_OBJS) $(GSLITE_LIB)
	link $(GSLTOBJ)gslt_font_test.$(OBJ) gsltimp.lib


check: gslt_font_test.exe gslt_image_test.exe
	gslt_font_test ..\..\urwfonts\CenturySchL-Bold.ttf
	gslt_image_test tiger.jpg

clean:
	del *.pnm *.pbm *.lib *.exe obj\*.obj *.obj obj\*.tr