1# Makefile
2#
3# Makefile for resumes
4#
5# Copyright (c) 2002 Bruce Christensen
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions are
10# met:
11#
12# 1. Redistributions of source code must retain the above copyright
13#    notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright
15#    notice, this list of conditions and the following disclaimer in the
16#    documentation and/or other materials provided with the
17#    distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
23# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
29# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31#------------------------------------------------------------------------------
32# To create example.html, example.txt, example.fo, and example.pdf from
33# example.xml, with Italian localization and a4 paper size, use this command:
34#
35# 	gmake resume=example country=it papersize=a4
36#
37# To generate just the html version of cv.xml with UK localization, use this
38# command:
39#
40# 	gmake html resume=cv country=uk
41#
42# To remove all generated files, run:
43#
44# 	gmake clean
45#------------------------------------------------------------------------------
46
47#------------------------------------------------------------------------------
48# Basename (filename minus .xml extension) of resume to process
49# For example, put "myresume" here to process "myresume.xml".
50#------------------------------------------------------------------------------
51resume = resume
52
53#------------------------------------------------------------------------------
54# Stylesheets
55#------------------------------------------------------------------------------
56# Options: br de fr it nl uk us es
57country = us
58# Options: letter for country=us, a4 for others
59papersize = letter
60
61xsl_base = http://xmlresume.sourceforge.net/xsl
62#xsl_base = ../xsl
63#xsl_base = ../src/www/xsl
64
65html_style = $(xsl_base)/output/$(country)-html.xsl
66text_style = $(xsl_base)/output/$(country)-text.xsl
67fo_style = $(xsl_base)/output/$(country)-$(papersize).xsl
68upgrade_13x_140_style = $(xsl_base)/misc/13x-140.xsl
69
70#------------------------------------------------------------------------------
71# Processing software
72#------------------------------------------------------------------------------
73make = gmake
74
75xsl_proc = java org.apache.xalan.xslt.Process $(xsl_flags) -in $(in) -xsl $(xsl) -out $(out)
76#xsl_proc = java com.icl.saxon.StyleSheet $(xsl_flags) -o $(out) $(in) $(xsl) $(xsl_params)
77
78pdf_proc = java org.apache.fop.apps.Fop -fo $(fo_flags) $(in) -pdf $(out)
79#pdf_proc = ~/bin/xep/run.sh $(fo_flags) $(in) $(out)
80
81# RTF generation currently requires you download a separate, closed source jar
82# file and add it to your java classpath:
83# http://www.xmlmind.com/foconverter/downloadperso.shtml
84rtf_proc = java com.xmlmind.fo.converter.Driver $(in) $(out)
85#rtf_proc = java ch.codeconsult.jfor.main.CmdLineConverter $(in) $(out)
86
87# Element filtering allows you to create targeted resumes.
88# You can create your own targets; just specify them in your resume.xml
89# file with the "targets" attribute.  In this example, the foodservice
90# AND carpentry elements will be included in the output, but not the
91# elements targeted to other jobs.  Untargeted elements (those with no
92# "targets" attribute) are always included.
93# Take a look at example2.xml and try changing the filter targets to get a
94# feel for how the filter works.
95filter_targets = foodservice carpentry
96filter_proc = java net.sourceforge.xmlresume.filter.Filter -in $(in) -out $(out) $(filter_targets)
97
98#------------------------------------------------------------------------------
99# End configurable parameters
100#------------------------------------------------------------------------------
101
102.PHONY: all html text fo pdf clean 13x-140
103
104all: html text fo pdf
105html: $(resume).html
106text: $(resume).txt
107fo: $(resume).fo
108pdf: $(resume).pdf
10913x-140: $(resume)-140.xml
110rtf: $(resume).rtf
111filter: $(resume)-filtered.xml
112
113clean:
114	rm -f $(resume).html
115	rm -f $(resume).txt
116	rm -f $(resume).fo
117	rm -f $(resume).pdf
118	rm -f $(resume).rtf
119	rm -f $(resume)-filtered.xml
120	rm -f $(resume)-filtered.html
121	rm -f $(resume)-filtered.txt
122	rm -f $(resume)-filtered.pdf
123	rm -f $(resume)-filtered.fo
124	rm -f $(resume)-filtered.rtf
125
126$(resume).html: in = $(resume).xml
127$(resume).html: out = $(resume).html
128$(resume).html: xsl = $(html_style)
129$(resume).html: $(resume).xml
130	$(xsl_proc)
131
132$(resume).txt: in = $(resume).xml
133$(resume).txt: out = $(resume).txt
134$(resume).txt: xsl = $(text_style)
135$(resume).txt: $(resume).xml
136	$(xsl_proc)
137
138$(resume).fo: in = $(resume).xml
139$(resume).fo: out = $(resume).fo
140$(resume).fo: xsl = $(fo_style)
141$(resume).fo: $(resume).xml
142	$(xsl_proc)
143
144$(resume).pdf: in = $(resume).fo
145$(resume).pdf: out = $(resume).pdf
146$(resume).pdf: $(resume).fo
147	$(pdf_proc)
148
149$(resume).rtf: in = $(resume).fo
150$(resume).rtf: out = $(resume).rtf
151$(resume).rtf: $(resume).fo
152	$(rtf_proc)
153
154$(resume)-140.xml: in = $(resume).xml
155$(resume)-140.xml: out = $(resume)-140.xml
156$(resume)-140.xml: xsl = $(upgrade_13x_140_style)
157$(resume)-140.xml: $(resume).xml
158	$(xsl_proc)
159
160$(resume)-filtered.xml: in = $(resume).xml
161$(resume)-filtered.xml: out = $(resume)-filtered.xml
162$(resume)-filtered.xml: $(resume).xml
163	$(filter_proc)
164	$(make) all resume=$(resume)-filtered
165