1 # makefile for Haru Free PDFLibrary II (Libharu)
2 # Copyright (C) 1999-2006 Takeshi Kanno
3 # For conditions of distribution and use, see copyright notice in hpdf.h
7 # If you wish to build zlib as a shared library, use: ./configure -s
8 # To install /usr/local/lib/libhpdf.* and /usr/local/include/hpdf.h, type:
10 # To install in $HOME instead of /usr/local, use:
11 # make install prefix=$HOME
21 CFLAGS=-Iinclude -O2 -Wall
22 CFLAGS_DEMO=-Iinclude -O2 -Wall
26 LDFLAGS_DEMO2=-L. -lhpdf -lpng -lz
27 DEFNAME=win32/mingw/libhpdf_cdecl.def
28 RESNAME=win32/mingw/libhpdf_cygwin.res
49 src/hpdf_encryptdict.o \
51 src/hpdf_fontdef_tt.o \
52 src/hpdf_fontdef_type1.o \
53 src/hpdf_fontdef_base14.o \
54 src/hpdf_fontdef_cid.o \
56 src/hpdf_font_type1.o \
62 src/hpdf_page_label.o\
65 src/hpdf_page_operator.o \
66 src/hpdf_destination.o \
67 src/hpdf_annotation.o \
70 src/hpdf_encoder_jp.o \
71 src/hpdf_encoder_kr.o \
72 src/hpdf_encoder_cns.o \
73 src/hpdf_encoder_cnt.o \
74 src/hpdf_fontdef_jp.o \
75 src/hpdf_fontdef_kr.o \
76 src/hpdf_fontdef_cns.o \
77 src/hpdf_fontdef_cnt.o \
78 src/hpdf_image_png.o \
79 src/hpdf_image_ccitt.o \
81 src/hpdf_ext_gstate.o \
82 src/hpdf_3dmeasure.o \
96 demo/link_annotation \
99 demo/text_annotation \
104 demo/raw_image_demo \
107 demo/slide_show_demo \
108 demo/ext_gstate_demo \
115 ar rc $(LIBNAME) $(OBJS)
119 $(CC) -Wall -shared -o $(SONAME) $(OBJS) $(DEFNAME) $(RESNAME) -Wl,--kill-at,--enable-stdcall-fixup $(LDFLAGS)
120 dlltool -k -d $(DEFNAME) -l $(LIBNAME)
125 demo: $(LIBTARGET) $(PROGRAMS)
128 rm -f src/*.o src/*.obj ./*.a ./*.so* ./*.lib demo/*.exe
130 install: all installfiles
133 if [ ! -d $(PREFIX) ]; then mkdir -p $(PREFIX); fi
134 if [ ! -d $(PREFIX)/include ]; then mkdir -p $(PREFIX)/include; fi
135 if [ ! -d $(PREFIX)/lib ]; then mkdir -p $(PREFIX)/lib; fi
136 cp include/hpdf*.h $(PREFIX)/include/; chmod 644 $(PREFIX)/include/hpdf*.h
137 cp -p $(LIBNAME) $(PREFIX)/lib/
142 $(CC) -o $@ $(CFLAGS) -c $*.c
144 demo/encoding_list : demo/encoding_list.c $(LIBTARGET)
145 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/encoding_list.c $(LDFLAGS_DEMO2)
146 cd demo/ ; ./encoding_list
148 demo/font_demo : demo/font_demo.c $(LIBTARGET)
149 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/font_demo.c $(LDFLAGS_DEMO2)
150 cd demo/ ; ./font_demo
152 demo/text_demo : demo/text_demo.c demo/grid_sheet.c $(LIBTARGET)
153 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/text_demo.c demo/grid_sheet.c $(LDFLAGS_DEMO2)
154 cd demo/ ; ./text_demo
156 demo/text_demo2 : demo/text_demo2.c demo/grid_sheet.c $(LIBTARGET)
157 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/text_demo2.c demo/grid_sheet.c $(LDFLAGS_DEMO2)
158 cd demo/ ; ./text_demo2
160 demo/image_demo : demo/image_demo.c $(LIBTARGET)
161 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/image_demo.c $(LDFLAGS_DEMO2)
162 cd demo/ ; ./image_demo
164 demo/jpeg_demo : demo/jpeg_demo.c $(LIBTARGET)
165 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/jpeg_demo.c $(LDFLAGS_DEMO2)
166 cd demo/ ; ./jpeg_demo
168 demo/jpfont_demo : demo/jpfont_demo.c $(LIBTARGET)
169 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/jpfont_demo.c $(LDFLAGS_DEMO2)
170 cd demo/ ; ./jpfont_demo
172 demo/line_demo : demo/line_demo.c $(LIBTARGET)
173 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/line_demo.c $(LDFLAGS_DEMO2)
174 cd demo/ ; ./line_demo
176 demo/link_annotation : demo/link_annotation.c $(LIBTARGET)
177 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/link_annotation.c $(LDFLAGS_DEMO2)
178 cd demo/ ; ./link_annotation
180 demo/outline_demo : demo/outline_demo.c $(LIBTARGET)
181 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/outline_demo.c $(LDFLAGS_DEMO2)
182 cd demo/ ; ./outline_demo
184 demo/png_demo : demo/png_demo.c $(LIBTARGET)
185 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/png_demo.c $(LDFLAGS_DEMO2)
186 cd demo/ ; ./png_demo
188 demo/text_annotation : demo/text_annotation.c $(LIBTARGET)
189 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/text_annotation.c $(LDFLAGS_DEMO2)
190 cd demo/ ; ./text_annotation
192 demo/encryption : demo/encryption.c $(LIBTARGET)
193 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/encryption.c $(LDFLAGS_DEMO2)
194 cd demo/ ; ./encryption
196 demo/permission : demo/permission.c $(LIBTARGET)
197 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/permission.c $(LDFLAGS_DEMO2)
198 cd demo/ ; ./permission
200 demo/ttfont_demo : demo/ttfont_demo.c $(LIBTARGET)
201 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/ttfont_demo.c $(LDFLAGS_DEMO2)
202 cd demo/ ; ./ttfont_demo ttfont/PenguinAttack.ttf -E
204 demo/character_map : demo/character_map.c $(LIBTARGET)
205 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/character_map.c $(LDFLAGS_DEMO2)
207 demo/raw_image_demo : demo/raw_image_demo.c $(LIBTARGET)
208 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/grid_sheet.c demo/raw_image_demo.c $(LDFLAGS_DEMO2)
209 cd demo/ ; ./raw_image_demo
211 demo/arc_demo : demo/arc_demo.c demo/grid_sheet.c $(LIBTARGET)
212 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/grid_sheet.c demo/arc_demo.c $(LDFLAGS_DEMO2)
213 cd demo/ ; ./arc_demo
215 demo/grid_sheet : demo/grid_sheet.c $(LIBTARGET)
216 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) -DSTAND_ALONE $(LDFLAGS_DEMO1) demo/grid_sheet.c $(LDFLAGS_DEMO2)
217 cd demo/ ; ./grid_sheet
219 demo/slide_show_demo : demo/slide_show_demo.c $(LIBTARGET)
220 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/slide_show_demo.c $(LDFLAGS_DEMO2)
221 cd demo/ ; ./slide_show_demo
223 demo/ext_gstate_demo : demo/ext_gstate_demo.c $(LIBTARGET)
224 $(CC) $(CFLAGS_EXE)$@ $(CFLAGS_DEMO) $(LDFLAGS_DEMO1) demo/ext_gstate_demo.c $(LDFLAGS_DEMO2)
225 cd demo/ ; ./ext_gstate_demo