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

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

all: codegen allsubs

clean: cleansubs
	rm -f *~

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



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) && $(XT) ../$(PROPERTIESXML) ../$(PROPERTIESXSL)

charlist: $(CHARLISTXML) $(CHARLISTXSL)
	cd $(GENDIR) && $(XT) ../$(CHARLISTXML) ../$(CHARLISTXSL)

fonts: $(FONTXML) $(FONTXSL)
	cd $(GENDIR) && for font in $(FONTXML) ; do $(XT) ../$$font ../$(FONTXSL) ; done

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)

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