File: Makefile

package info (click to toggle)
pdftk 1.44-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,824 kB
  • sloc: java: 52,396; cpp: 4,377; ansic: 249; makefile: 215; sh: 8
file content (105 lines) | stat: -rw-r--r-- 4,424 bytes parent folder | download
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
# -*- Mode: Makefile -*-
# Copyright 2003, 2004, 2010 Sid Steward
# This is part of pdftk
#
# Visit: www.pdftk.com for pdftk information and articles
# Permalink: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
#
# Please email Sid Steward with questions or bug reports.
# Include "pdftk" in the subject line to ensure successful delivery:
# sid.steward at pdflabs dot com
#
# Skipping RTF package because gcjh is complaining that
# a static member has the same name as a method, but doesn't
# tell me where the ambiguity is.  Since it isn't needed for
# pdftk, I left it out until I have time to find the trouble.
#
# also omitting hyphenation, html, since they aren't needed by pdftk

JAVALIBPATH= $(CURDIR)

# preprocess this file so it might include our local copies of library objects: libgcj_local
com/lowagie/text/pdf/PdfEncryption.java : com/lowagie/text/pdf/PdfEncryption.java.c
ifdef USE_LOCAL_LIBGCJ
	cpp -C -P -DPDFTK_JAVA_LOCAL com/lowagie/text/pdf/PdfEncryption.java.c com/lowagie/text/pdf/PdfEncryption.java
else
	cpp -C -P com/lowagie/text/pdf/PdfEncryption.java.c com/lowagie/text/pdf/PdfEncryption.java
endif

#
export GCJFLAGS+= --encoding=UTF-8 --classpath="$(LIBGCJ):$(JAVALIBPATH):."
export GCJHFLAGS+= --classpath="$(LIBGCJ):$(JAVALIBPATH):."

sources= $(wildcard com/lowagie/text/*.java)
sources+= $(wildcard com/lowagie/text/markup/*.java)
sources+= $(wildcard com/lowagie/text/pdf/*.java)
sources+= com/lowagie/text/pdf/PdfEncryption.java
#sources+= $(wildcard com/lowagie/text/pdf/codec/*.java)
#sources+= $(wildcard com/lowagie/text/pdf/codec/wmf/*.java)
#sources+= $(wildcard com/lowagie/text/pdf/codec/postscript/*.java)
sources+= $(wildcard com/lowagie/text/pdf/fonts/*.java)
sources+= $(wildcard com/lowagie/text/xml/xmp/*.java)
#sources+= $(wildcard com/lowagie/bc/asn1/*.java)
sources+= $(wildcard org/bouncycastle/util/*.java)
sources+= $(wildcard org/bouncycastle/util/encoders/*.java)
sources+= $(wildcard org/bouncycastle/util/io/*.java)
sources+= $(wildcard org/bouncycastle/asn1/*.java)

headers= $(patsubst %.java, %.h, $(sources))

# for afm resources
afms= $(wildcard com/lowagie/text/pdf/fonts/*.afm)

ifdef GCJ_LOCAL_LIB
libgcj_local_sources= $(wildcard gnu_local/java/security/*.java)
libgcj_local_sources+= $(wildcard gnu_local/java/security/provider/*.java)
libgcj_local_sources+= $(wildcard java_local/security/*.java)
#
libgcj_local_classes= $(patsubst %.java, %.class, $(libgcj_local_sources))
endif

# don't automatically delete intermediate class files
.PRECIOUS : %.class

%.class : %.java
	$(GCJ) $(GCJFLAGS) -C $<

%.h : %.class
	$(GCJH) $(GCJHFLAGS) $*

# don't create class list from java filenames because it omits local classes
java_lib.o : $(headers) $(sources)
	$(GJAR) -cf java_lib.jar com/lowagie/*/*/*/*.class com/lowagie/*/*/*.class com/lowagie/*/*.class org/bouncycastle/*/*.class org/bouncycastle/*/*/*.class $(afms)
	$(GCJ) $(GCJFLAGS) -c java_lib.jar

ifdef GCJ_LOCAL_LIB
$(GCJ_LOCAL_LIB) : $(libgcj_local_classes)
	$(GJAR) -cf gcj_local_lib.jar gnu_local/java/security/*.class gnu_local/java/security/provider/*.class java_local/security/*.class
	$(GCJ) $(GCJFLAGS) -c gcj_local_lib.jar
endif

all : com/lowagie/text/pdf/PdfEncryption.java java_lib.o $(GCJ_LOCAL_LIB)

clean : itext_clean libgcj_local_clean

itext_clean :
	$(RM) $(RMFLAGS) java_lib.jar java_lib.o;
	$(RM) $(RMFLAGS) com/lowagie/text/pdf/PdfEncryption.java;
	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/markup" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/pdf" clean;
#	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/pdf/codec" clean;
#	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/pdf/codec/wmf" clean;
#	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/pdf/codec/postscript" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/pdf/fonts" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/text/xml/xmp" clean;
#	$(MAKE) -iC "$(JAVALIBPATH)/com/lowagie/bc/asn1" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/org/bouncycastle/util" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/org/bouncycastle/util/encoders" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/org/bouncycastle/util/io" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/org/bouncycastle/asn1" clean;

libgcj_local_clean :
	$(MAKE) -iC "$(JAVALIBPATH)/gnu_local/java/security" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/gnu_local/java/security/provider" clean;
	$(MAKE) -iC "$(JAVALIBPATH)/java_local/security" clean;