summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 6c9a545053a5974a47bcfb1dcaa95332f7a0f456 (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
# makefile for fop
#
# use gmake
#
BASEDIR=.

APIDOCDIR=docs/api

include $(BASEDIR)/Makefile.rules

SUBDIRS=src

CODEGEN=src/codegen

GENDIR=generated

JARTEMP=jartemp

JARTOC=jartoc

JARFILE=fop.jar

SRCJAR=fopsrc.jar

FONTXMLBASE=Courier.xml \
	Courier-Oblique.xml \
	Courier-Bold.xml \
	Courier-BoldOblique.xml \
	Helvetica.xml \
	Helvetica-Oblique.xml \
	Helvetica-Bold.xml \
	Helvetica-BoldOblique.xml \
	Times-Roman.xml \
	Times-Italic.xml \
	Times-Bold.xml \
	Times-BoldItalic.xml 

FONTXML=$(FONTXMLBASE:%=$(CODEGEN)/%)

FONTXSL=$(CODEGEN)/font-file.xsl

PROPERTIESXML=$(CODEGEN)/properties.xml
PROPERTIESXSL=$(CODEGEN)/properties.xsl
CHARLISTXML  =$(CODEGEN)/charlist.xml
CHARLISTXSL  =$(CODEGEN)/code-point-mapping.xsl

PACKAGES=org.apache.fop.apps \
	org.apache.fop.datatypes \
	org.apache.fop.fo \
	org.apache.fop.fo.flow \
	org.apache.fop.fo.pagination \
	org.apache.fop.image \
	org.apache.fop.layout \
	org.apache.fop.pdf \
	org.apache.fop.render \
	org.apache.fop.render.awt \
	org.apache.fop.render.pdf \
	org.apache.fop.render.xml \
	org.apache.fop.svg \
	org.apache.fop.viewer \
	org.apache.fop.fo.properties \
	org.apache.fop.render.pdf.fonts


all: codegen allsubs

clean: cleansubs
	rm -f *~

clobber: clean
	rm -rf $(GENDIR)
	rm -rf $(JARTEMP) $(JARTOC) $(JARFILE)
	rm -f $(SRCJAR)
	rm -rf $(APIDOCDIR)

codegen: $(GENDIR) compilegen

compilegen: properties charlist fonts
	cd $(GENDIR) && \
	($(FIND) . -name \*.java -print > javafiletoc) && \
	for javafile in `cat javafiletoc` ; do \
		echo $(JAVAC) $(GEN_JAVAC_ARGS) $$javafile ;\
		$(JAVAC) $(GEN_JAVAC_ARGS) $$javafile ;\
	done

$(GENDIR): 
	mkdir -p $(GENDIR)/org/apache/fop/fo/properties;
	mkdir -p $(GENDIR)/org/apache/fop/render/pdf/fonts;

properties: $(PROPERTIESXML) $(PROPERTIESXSL)
	cd $(GENDIR) && $(XALAN) -IN ../$(PROPERTIESXML) -XSL ../$(PROPERTIESXSL)

charlist: $(CHARLISTXML) $(CHARLISTXSL)
	cd $(GENDIR) && $(XALAN) -IN ../$(CHARLISTXML) -XSL ../$(CHARLISTXSL)

fonts: $(FONTXML) $(FONTXSL)
	cd $(GENDIR) && for font in $(FONTXML) ; do $(XALAN) -IN ../$$font -XSL ../$(FONTXSL) ; done

docs: all $(APIDOCDIR) 
	$(JAVADOC) $(JAVADOC_ARGS) $(PACKAGES)

dist: all $(JARTEMP) distgen distorg
	rm -f $(JARFILE)
	cd $(JARTEMP) && $(JAR) -cf ../$(JARFILE) *
	rm -rf $(JARTEMP) $(JARTOC)

srcdist: clobber
	$(JAR) -cf $(SRCJAR) .

$(JARTEMP):
	mkdir $(JARTEMP)

$(APIDOCDIR):
	mkdir $(APIDOCDIR)

distgen:
	cd $(GENDIR) && \
	rm -f $(JARTOC) && \
	($(FIND) . -name \*.class -print > $(JARTOC)) && \
	($(TAR) -cf - -T $(JARTOC) | (cd ../$(JARTEMP); $(TAR) -xf - )) 

distorg:
	cd src && \
	rm -f $(JARTOC) && \
	($(FIND) org -name \*.class -print > $(JARTOC)) && \
	($(TAR) -cf - -T $(JARTOC) | (cd ../$(JARTEMP); $(TAR) -xf - ))

$(TARGETS:%=%subs): %subs :
	for dir in $(SUBDIRS) ; do \
		(cd $$dir && pwd && $(MAKE) $(MFLAGS) $*) || exit 1 ; \
	done