summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-2.1.0/windows/Makefile.w32
blob: 22e0256b82d1d4edd89cb9f7c6aafd99351ec466 (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
# Makefile form Microsoft C++ nmake.exe
# $Id$
!IFNDEF WITH_DEVEL
WITH_DEVEL          = ../../deps
!ENDIF

!IFNDEF WITH_BUILD
WITH_BUILD = ..\..\gdbuild
!ENDIF

!IFDEF WITH_PNG
!IF "$(WITH_PNG)"=="dll"
PNG_LIBS     = libpng.lib
USE_LIBPNG      = true
PNG          = dll
!ELSEIF "$(WITH_PNG)"=="static"
PNG_LIBS     = libpng_a.lib
USE_LIBPNG   = true
PNG          = static
!ELSE
USE_LIBPNG   = false
!ENDIF
!ENDIF

!IFDEF WITH_JPEG
!IF "$(WITH_JPEG)"=="dll"
JPEG_LIBS     = libjpeg.lib
USE_LIBJPEG      = true
PNG          = dll
!ELSEIF "$(WITH_JPEG)"=="static"
JPEG_LIBS     = libjpeg_a.lib
USE_LIBJPEG   = true
PNG          = static
!ELSE
USE_LIBJPEG   = false
!ENDIF
!ENDIF

EXTRA_INCLUDE=$(WITH_DEVEL)/include
EXTRA_LIBS=/libpath:$(WITH_DEVEL)/lib

CC=cl.exe
LD=link.exe
BUILD=Release
#BUILD=Debug

LIBGD_SRC_DIR=..\src
LIBGD_OBJ_DIR=$(WITH_BUILD)
LIBGD_BIN_DIR=$(WITH_BUILD)\bin

!MESSAGE library source:  $(LIBGD_SRC_DIR)
!MESSAGE library objects: $(LIBGD_OBJ_DIR)

LIBGDCFLAGS= \
   /D PATHSEPARATOR="\";\"" \
   /D DEFAULT_FONTPATH="\"C:\\WINDOWS\\FONTS;C:\\WINNT\\FONTS\"" \

#LIBS=libjpeg.lib freetype2.lib libpng.lib zlib.lib kernel32.lib user32.lib advapi32.lib
LIBS=kernel32.lib user32.lib advapi32.lib

!IF "$(USE_LIBPNG)" == "true"
LIBPNG_CFLAGS   = $(LIBPNG_CFLAGS) /I"$(WITH_DEVEL)/include/libpng15"  /D HAVE_LIBPNG
LIBS= $(LIBS) libpng_a.lib
!ENDIF

CFLAGS=/c -I. -I.. -I../src -I$(EXTRA_INCLUDE) -nologo -DWIN32 -D_WIN32 -DMSWIN32 -DBGDWIN32 $(LIBGDCFLAGS)
#LIBS=libjpeg.lib freetype2.lib libpng.lib zlib.lib kernel32.lib user32.lib advapi32.lib

!if "$(BUILD)" == "Debug"
CFLAGS=$(CFLAGS) /Od /Zi /MTd /D_DEBUG /LDd
LDFLAGS=/DEBUG $(LDFLAGS) /nodefaultlib:msvcrt.lib  $(EXTRA_LIBS)
LIBS=$(LIBS) msvcrtd.lib
!else
CFLAGS=$(CFLAGS) /Oi /O2 /Oy /GF /MT /DNDEBUG /LD
LDFLAGS=/nodefaultlib:msvcrtd.lib $(EXTRA_LIBS)
LIBS=$(LIBS) msvcrt.lib
!endif

CPPFLAGS=$(CFLAGS)

!if "$(DLLNAME)" == ""
DLLNAME=libgd.dll
!endif

DYNAMICLIB=$(DLLNAME:.dll=.lib)

!if "$(STATICLIB)" == ""
STATICLIB=libgd_a.lib
!endif

LIB_OBJS= \
  $(LIBGD_OBJ_DIR)\gd.obj \
  $(LIBGD_OBJ_DIR)\gdcache.obj \
  $(LIBGD_OBJ_DIR)\gdfontg.obj \
  $(LIBGD_OBJ_DIR)\gdfontl.obj \
  $(LIBGD_OBJ_DIR)\gdfontmb.obj \
  $(LIBGD_OBJ_DIR)\gdfonts.obj \
  $(LIBGD_OBJ_DIR)\gdfontt.obj \
  $(LIBGD_OBJ_DIR)\gdft.obj \
  $(LIBGD_OBJ_DIR)\gdfx.obj \
  $(LIBGD_OBJ_DIR)\gd_gd2.obj \
  $(LIBGD_OBJ_DIR)\gd_gd.obj \
  $(LIBGD_OBJ_DIR)\gd_gif_in.obj \
  $(LIBGD_OBJ_DIR)\gd_gif_out.obj \
  $(LIBGD_OBJ_DIR)\gdhelpers.obj \
  $(LIBGD_OBJ_DIR)\gd_io.obj \
  $(LIBGD_OBJ_DIR)\gd_io_dp.obj \
  $(LIBGD_OBJ_DIR)\gd_io_file.obj \
  $(LIBGD_OBJ_DIR)\gd_io_ss.obj \
  $(LIBGD_OBJ_DIR)\gd_jpeg.obj \
  $(LIBGD_OBJ_DIR)\gd_security.obj \
  $(LIBGD_OBJ_DIR)\gdkanji.obj \
  $(LIBGD_OBJ_DIR)\gd_png.obj \
  $(LIBGD_OBJ_DIR)\gd_ss.obj \
  $(LIBGD_OBJ_DIR)\gdtables.obj \
  $(LIBGD_OBJ_DIR)\gd_topal.obj \
  $(LIBGD_OBJ_DIR)\gd_transform.obj \
  $(LIBGD_OBJ_DIR)\gd_wbmp.obj \
  $(LIBGD_OBJ_DIR)\gdxpm.obj \
  $(LIBGD_OBJ_DIR)\wbmp.obj \
  $(LIBGD_OBJ_DIR)\gd_interpolation.obj \
  $(LIBGD_OBJ_DIR)\gd_matrix.obj \
  $(LIBGD_OBJ_DIR)\gd_rotate.obj

EXE_OBJS= \
  annotate.obj \
  circletexttest.obj \
  fontconfigtest.obj \
  fontsizetest.obj \
  fontwheeltest.obj \
	gd2copypal.obj \
	gd2togif.obj \
	gd2topng.obj \
	gdcmpgif.obj \
	gdparttopng.obj \
	gdtopng.obj \
	giftogd2.obj \
	gdtest.obj \
	gdtestft.obj \
	gifanimtest.obj \
	pngtogd.obj \
	pngtogd2.obj \
	testac.obj \
	testtr.obj \
	webpng.obj

$(LIBGD_OBJ_DIR):
	@if not exist $(LIBGD_OBJ_DIR) mkdir $(LIBGD_OBJ_DIR)

$(LIBGD_BIN_DIR):
	@if not exist $(LIBGD_BIN_DIR) mkdir $(LIBGD_BIN_DIR)

all: $(LIBGD_OBJ_DIR) $(LIBGD_BIN_DIR) $(LIB_OBJS) $(STATICLIB)

.SUFFIXES: .c .obj .res

{$(LIBGD_SRC_DIR)\}.c{$(LIBGD_OBJ_DIR)\}.obj:
	$(CC) $(CFLAGS) /Fo"$@"  $<

$(STATICLIB): $(LIB_OBJS)
	$(LD) /lib /out:$(LIBGD_BIN_DIR)/$(STATICLIB) $(LIB_OBJS)

dist: all
	-rmdir /s /q distro
	mkdir distro
	mkdir distro\bin
	copy *.exe distro\bin
	copy *.dll distro\bin
	mkdir distro\include
	copy ..\*.h distro\include
	mkdir distro\lib
	copy *.lib distro\lib
	copy ..\COPYING distro\COPYING.TXT
	
clean:
	-del /q $(LIBGD_OBJ_DIR)\*.obj $(LIBGD_OBJ_DIR)\*.dll $(LIBGD_OBJ_DIR)\*.lib $(LIBGD_OBJ_DIR)\*.ilk $(LIBGD_OBJ_DIR)\*.pdb $(LIBGD_OBJ_DIR)\*.exp $(LIBGD_OBJ_DIR)\*.exe $(LIBGD_OBJ_DIR)\*.png $(LIBGD_OBJ_DIR)\*.res
	-rmdir /s /q distro