update the curl patch for 7.60.0
[AROS-Contrib.git] / vpdf / makefile
blob22b81448ec31fb24902965e94095816fb752c5ae
1 # "show" Makefile
3 CXX=ppc-morphos-g++-4
4 CC=ppc-morphos-gcc
5 LD=ppc-morphos-gcc-4
6 SHELL = /bin/sh
8 JPEGSHARED = ../../libs/jpeg6b/lib/
9 FREETYPESHARED = ../../libs/freetype/library/lib/
10 ROOTPATH=../../../
11 APPLICATION = VPDF
12 CATALOGS = polski
13 CATALOGDIR = MorphOS/Locale/Catalogs
14 NEWCATCOMP = $(ROOTPATH)morphoswb/development/tools/catcomp/catcomp.pl
16 VERBOSE ?= 0
17 ifneq ($(BUILD_QUIET_COMPILE), y)
18 VERBOSE = 0
19 endif
21 ifeq ($(wildcard ../showgirls/History),)
22 INMORPHOS=n
23 else
24 INMORPHOS=y
25 endif
27 ifeq ($(VERBOSE), 0)
28 OUT = @
29 ECHO = @echo
30 QUIET = >/dev/null
31 else
32 OUT = @
33 ECHO = @echo >/dev/null
34 QUIET =
35 endif
37 #CPPFLAGS = -O3 -Wall -mfused-madd -mmultiple -mcpu=750 -ffast-math -fomit-frame-pointer -noixemul -Isystem -Lsystem -Ifx -Lfx -Imcc -Lmcc -I. -Llib -Ilibjpeg -Llibjpeg -Llibpng -Lexif -Llibz
38 #CPPFLAGS = -O0 -Wall -mfused-madd -mmultiple -ffast-math -fomit-frame-pointer -noixemul -Isystem -Lsystem -Imcc -Lmcc -I. -Llib
40 #FONTCONFIGLIB = -lfontconfig
41 FONTCONFIGINC = -I../../libs/fontconfig/MorphOS/include
43 CPPFLAGS = -g -O2 -Wno-write-strings -Wall -mfused-madd -mmultiple -mcpu=750 -noixemul -fno-inline-functions -Isystem -Lsystem -Imcc -Lmcc -I. -Llib -Ipoppler/poppler/ -Ipoppler
44 #CPPFLAGS = -D__MORPHOS_SHAREDLIBS -O2 -Wall -mfused-madd -mmultiple -mcpu=750 -noixemul -fno-inline-functions -Isystem -Lsystem -Ifx -Lfx -Imcc -Lmcc -I. -Llib -Llibpng -Llibjpeg -Lexif -Llibz -Lalbum
46 ifeq ($(INMORPHOS),y)
47 CPPFLAGS += -I../showgirls -I../showgirls/system -I../../libs/cairo/cairo-src/MorphOS/include/cairo -I../../libs/cairo/cairo-src/MorphOS/include -I../../../include -I../../libs/freetype/library/include ${FONTCONFIGINC} -I../../libs/freetype/include
48 CPPFLAGS += -L$(JPEGSHARED) -L$(FREETYPESHARED)
49 else
50 # For building with the public SDK
51 CPPFLAGS += -Iinclude -Iinclude/cairo -Lsystem
52 endif
54 #selection between shared libs and staticly linnked
55 OBJS = locale.o vpdf.o poppler_io.o poppler.o clipboard.o window.o application.o logger.o settings.o fontcache.o arrowstring_class.o pagenumberclass.o printer.o poppler_printer.o printer_image.o
57 #selection between shared libs and staticly linnked
58 CAIRO_LIBS = ${FONTCONFIGLIB} -lcairo
59 POPPLER_LIBS = -lpoppler -lgoo -lfofi -lpoppler-splash
60 #LIBS_SHARED = -L../poppler-0.11.1/poppler/.libs/ -lpoppler-cairo -lfontconfig -lcairo -lpoppler -lfontconfig -lfreetype-2.3.8 -lexpat -L../showgirls/system -L../showgirls/mcc -L../lairecvs/morphos/morphoswb/apps/showgirls/system -lsystem -lmuiclasses -lsystem -lmoto -L. -ljpeg_shared -lpng_shared -I../showgirls -ldebug -lsyscall -ljpeg_shared -lpng_shared -liconv
61 #LIBS_SHARED = -L../poppler-0.11.1/poppler/.libs/ $(CAIRO_LIBS) -lpoppler -lfontconfig -lfreetypeauto -lexpat -L../showgirls/system -L../showgirls/mcc -L../lairecvs/morphos/morphoswb/apps/showgirls/system -lsystem -lmuiclasses -lsystem -lmoto -L. -ljpeg_shared -lpng_shared -I../showgirls -ldebug -lsyscall -ljpeg_shared -lpng_shared -liconv
62 LIBS_SHARED = -Lpoppler/poppler/ -Lpoppler/fofi/ -Lpoppler/splash -Lpoppler/goo $(CAIRO_LIBS) -L../showgirls/system -L../showgirls/mcc -L../../libs/fontconfig/MorphOS/lib/libnix -L../../libs/cairo/cairo-src/MorphOS/lib/libnix -L../../libs/freetype/library/lib -L. -I../showgirls -lmuiclasses -lsystem -ldebug -lsyscall
63 LIBS=$(LIBS_SHARED) $(POPPLER_LIBS) $(CAIRO_LIBS) -lsystem -lfreetypeauto -ljpeg_shared -lstdc++ -lm -ldebug -lsyscall
65 .PHONY: all install install-iso clean
67 all: catalogs libs version.h $(OBJS)
68 make -C poppler
69 make -C mcc
70 $(LD) $(CPPFLAGS) -o vpdf.db $(OBJS) $(LIBS)
71 ppc-morphos-strip vpdf.db --remove-section=.comment --strip-unneeded -o vpdf
72 chmod u+x vpdf
74 fontcache: fontcache.c
75 ppc-morphos-gcc-4.4.4 $(CPPFLAGS) -DSTANDALONE -c fontcache.c
76 ppc-morphos-gcc-4.4.4 $(CPPFLAGS) -o fontcache fontcache.o $(LIBS_SHARED) -lfreetypeauto
78 test: test.o
79 path
80 ppc-morphos-gcc-4.4.4 $(CPPFLAGS) -o test.exe test.o $(LIBS)
82 libs:
83 ifeq ($(INMORPHOS),y)
84 make -C ../../libs/cairo
85 make -C ../../libs/pixman
86 make -C ../../libs/freetype
87 make -C ../../libs/jpeg6b
88 endif
90 ifeq ($(INMORPHOS),n)
91 LIBSYSTEMOBJS = $(addprefix system/,altivec.o directory.o dlist.o file.o functions.o init.o memory.o timer.o)
93 system/libsystem.a: CC=ppc-morphos-gcc
94 system/libsystem.a: CPPFLAGS=-O2 -Wall -fvec -I. -Iinclude
95 system/libsystem.a: $(LIBSYSTEMOBJS)
96 rm -f $@
97 ppc-morphos-ar rcs $@ $^
99 all: system/libsystem.a
100 endif
102 VERSIONDATE = `date +%d.%m.%y`
103 VERSION = 1
104 REVISION = 1
106 version.h: FORCE
107 @echo 'updating version.h'
108 @echo '#define VERSION "'${VERSION}'"' >>version.h.new
109 @echo '#define REVISION "'${REVISION}'"' >>version.h.new
110 @echo '#define VERSIONDATE "'${VERSIONDATE}'"' >>version.h.new
111 @# only update when required prevent senseless rebuilds
112 @cmp -s version.h version.h.new 2>/dev/null || mv version.h.new version.h
113 @rm -f version.h.new
116 .c.o:
117 $(CC) $(CPPFLAGS) -c $< -o $@
118 .SUFFIXES: .cpp .c .o
120 clean:
121 make -C mcc clean
122 make -C poppler clean
123 rm -f *.o VPDF VPDF.db VPDF_strings.h
125 install-iso: all
126 mkdir -p $(ISOPATH)Applications/VPDF
127 mkdir -p $(ISOPATH)Applications/VPDF/Fonts
128 cp -r fonts/* $(ISOPATH)Applications/VPDF/Fonts
129 cp vpdf $(ISOPATH)Applications/VPDF/VPDF
130 cp vpdf.info $(ISOPATH)Applications/VPDF/VPDF.info
131 for i in `find $(ISOPATH)Applications/VPDF/ -name "CVS"`; do rm -rf $$i; done
132 for language in $(CATALOGS); \
133 do \
134 cp -f catalogs/$$language/$(APPLICATION).catalog $(ISOPATH)/MorphOS/Locale/Catalogs/$$language/; \
135 done
137 install: all
138 mkdir -p /sys/Applications/VPDF
139 mkdir -p /sys/Applications/VPDF/Fonts
140 cp -r fonts/* /sys/Applications/VPDF/Fonts
141 cp vpdf /sys/Applications/VPDF/VPDF
142 cp vpdf.info /sys/Applications/VPDF/VPDF.info
143 for i in `find /sys/Applications/VPDF/ -name "CVS"`; do rm -rf $$i; done
144 for language in $(CATALOGS); \
145 do \
146 cp -f catalogs/$$language/$(APPLICATION).catalog /MOSSYS/Locale/Catalogs/$$language/; \
147 done
149 source: $(APPLICATION)_strings.h
150 (cd .. && tar --exclude "*.info" -cf $(SOURCEPATH)vpdf.tar vpdf)
152 (cd ../showgirls/system && tar --transform "s,^,vpdf/system/," -rf $(SOURCEPATH)vpdf.tar altivec.h chunky.h data.h directory.h dlist.h file.h functions.h gentexture.h loadpng.h loadsunrast.h memory.h system.h timer.h)
153 (cd ../showgirls/system && tar --transform "s,^,vpdf/system/," -rf $(SOURCEPATH)vpdf.tar altivec.c directory.c dlist.c file.c functions.c init.c memory.c timer.c)
155 source-postgg:
156 (cd ../../libs/cairo/cairo-src/MorphOS && make headers lib/libnix/libcairo.a)
157 (cd ../../libs/freetype/library && make sdk)
158 (cd ../../libs/jpeg6b && make lib/libjpeg_shared.a)
160 (cd ../../development/os-include && tar --transform "s,^,vpdf/include/," -rf $(SOURCEPATH)vpdf.tar private/vapor/vapor.h)
161 (cd ../../libs/cairo/cairo-src/MorphOS && tar --transform "s,^,vpdf/," -rf $(SOURCEPATH)vpdf.tar include)
162 (cd ../../libs/freetype && tar --transform "s,^,vpdf/," -rf $(SOURCEPATH)vpdf.tar include)
163 (cd ../../libs/freetype/library && tar --transform "s,^,vpdf/," -rf $(SOURCEPATH)vpdf.tar include)
164 (cd ../../development/include && tar --transform "s,^,vpdf/include/," -rf $(SOURCEPATH)vpdf.tar fontconfig)
166 (cd ../../libs/cairo/cairo-src/MorphOS/lib/libnix && tar --transform "s,^,vpdf/lib/," -rf $(SOURCEPATH)vpdf.tar libcairo.a)
167 (cd ../../libs/freetype/library/lib && tar --transform "s,^,vpdf/lib/," -rf $(SOURCEPATH)vpdf.tar libfreetypeauto.a)
168 (cd ../../libs/jpeg6b/lib && tar --transform "s,^,vpdf/lib/," -rf $(SOURCEPATH)vpdf.tar libjpeg_shared.a)
170 dump:
171 objdump --section-headers --all-headers --reloc --disassemble-all --line-numbers vpdf.db >ram:zr.dump
173 dump-fontcache:
174 objdump --section-headers --all-headers --reloc --disassemble-all fontcache >ram:fontcache.dump
176 dumptest:
177 objdump --section-headers --all-headers --reloc --disassemble-all test.exe >ram:test.dump
180 bz2: all
181 rm -f vpdf.bz2
182 bzip2 -k vpdf
184 FORCE:
187 vpdf.o: vpdf.c mcc/classes.h poppler.h version.h locale.h VPDF_strings.h
188 application.o: application.c application.h poppler.h
189 logger.o: logger.c mcc/classes.h application.h
190 settings.o: settings.c mcc/classes.h settings.h
191 poppler.o: poppler.cpp poppler.h poppler_device.h
192 poppler_printer.o: poppler_printer.cpp poppler_device.h poppler_printer.h
193 poppler_io.o: poppler_io.cpp poppler_io.h
194 fontcache.o: fontcache.c fcstr.c fontcache.h
195 printer.o: printer.c mcc/classes.h VPDF_strings.h poppler_printer.h
196 pagenumberclass.o: pagenumberclass.c pagenumberclass.h
197 arrowstring_class.o: arrowstring_class.c arrowstring_class.h
198 printer.o: printer.c VPDF_strings.h
199 clipboard.o: clipboard.c clipboard.h
200 printer_image.o: printer_image.c printer_image.h
202 # locale
204 $(APPLICATION)_strings.h: $(APPLICATION).cd
205 ifeq ($(INMORPHOS),y)
206 $(ECHO) " $(COL_INFO)[CATCOMP]$(COL_END) $@"
207 $(OUT)$(NEWCATCOMP) --no-code --no-block -cd $(APPLICATION).cd --cfile $@
208 endif
210 .PHONY: catalogs
211 catalogs: $(patsubst %,catalogs/%/$(APPLICATION).catalog,$(CATALOGS))
213 %.catalog: %.ct $(APPLICATION).cd
214 $(ECHO) " $(COL_INFO)[CATCOMP]$(COL_END) $@"
215 $(OUT)$(NEWCATCOMP) -u -cd $(APPLICATION).cd -ct $< -o $@