Makefile 1.65 KB
Newer Older
1
##  Makefile (for maintenance purpose)
2 3 4 5
##

PACKAGE=pdfminer

6
PYTHON=python
7
GIT=git
8 9
RM=rm -f
CP=cp -f
10
MKDIR=mkdir
11 12 13 14

all:

install:
15
	$(PYTHON) setup.py install --home=$(HOME)
16 17 18

clean:
	-$(PYTHON) setup.py clean
19
	-$(RM) -r build dist MANIFEST
20 21
	-cd $(PACKAGE) && $(MAKE) clean
	-cd tools && $(MAKE) clean
22
	-cd samples && $(MAKE) clean
23

24
distclean: clean cmap_clean
25

26
sdist: distclean MANIFEST.in
27
	$(PYTHON) setup.py sdist
28
register: distclean MANIFEST.in
29 30
	$(PYTHON) setup.py sdist upload register

31
WEBDIR=../euske.github.io/$(PACKAGE)
32
publish:
33
	$(CP) docs/*.html docs/*.png docs/*.css $(WEBDIR)
34 35 36 37

CONV_CMAP=$(PYTHON) tools/conv_cmap.py
CMAPSRC=cmaprsrc
CMAPDST=pdfminer/cmap
38 39
cmap: $(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz $(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz \
	$(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz $(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz
40
cmap_clean:
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
	-$(RM) -r $(CMAPDST)
$(CMAPDST):
	$(MKDIR) $(CMAPDST)
$(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz: $(CMAPDST)
	$(CONV_CMAP) -c B5=cp950 -c UniCNS-UTF8=utf-8 \
		$(CMAPDST) Adobe-CNS1 $(CMAPSRC)/cid2code_Adobe_CNS1.txt
$(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz: $(CMAPDST)
	$(CONV_CMAP) -c GBK-EUC=cp936 -c UniGB-UTF8=utf-8 \
		$(CMAPDST) Adobe-GB1 $(CMAPSRC)/cid2code_Adobe_GB1.txt
$(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz: $(CMAPDST)
	$(CONV_CMAP) -c RKSJ=cp932 -c EUC=euc-jp -c UniJIS-UTF8=utf-8 \
		$(CMAPDST) Adobe-Japan1 $(CMAPSRC)/cid2code_Adobe_Japan1.txt
$(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz: $(CMAPDST)
	$(CONV_CMAP) -c KSC-EUC=euc-kr -c KSC-Johab=johab -c KSCms-UHC=cp949 -c UniKS-UTF8=utf-8 \
		$(CMAPDST) Adobe-Korea1 $(CMAPSRC)/cid2code_Adobe_Korea1.txt
56 57

test: cmap
58
	nosetests
59
	cd samples && $(MAKE) test