Debian Codegraph @

Makefile

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 OCAMLOPT = ocamlopt
2 OCAMLOPTFLAGS = -thread -w s
3 OCAMLOPTLIBS = str.cmxa unix.cmxa threads.cmxa
4 OCAMLINCS =
5 XOBJS = pdfsandwich_version.cmx
6
7 SOURCE = pdfsandwich.ml
8 TARGET = pdfsandwich
9 MANUAL = $(TARGET).1.gz
10
11 VERSION := $(shell cat pdfsandwich_version)
12
13 all: $(TARGET) $(MANUAL)
14
15 $(TARGET): $(XOBJS) $(SOURCE)
16 $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLINCS) $(OCAMLOPTLIBS) -o $@ $^
17
18
19 %.cmx: %.ml
20 $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLINCS) $(OCAMLOPTLIBS) -c $<
21
22 pdfsandwich_version.ml: pdfsandwich_version
23 echo "let pdfsandwich_version=\"$(VERSION)\";; (*automatically generated from file pdfsandwich_version*)" > $@
24
25 $(MANUAL): manual.txt
26 # you need gawk for this:
27 ./txt2man -t PDFSANDWICH manual.txt | gzip -9 > $(MANUAL)
28
29 # Canceling pathological implicit rule:
30 %: %.o
31
32 ##############
33 ### install
34 ##############
35
36 DOCFILES = copyright changelog
37
38 PREFIX = /usr/local
39 # this may overwrite PREFIX:
40 include makefile.installprefix
41
42 PREF = $(DESTDIR)$(PREFIX)
43 INSTALL = install -s
44 CP = cp
45 INSTALLBINDIR = $(PREF)/bin
46 INSTALLMANDIR = $(PREF)/share/man/man1
47 INSTALLDOCDIR = $(PREF)/share/doc/$(TARGET)
48
49 install: $(DOCFILES) $(ADDITIONAL)
50 (umask 0022; mkdir -p $(INSTALLBINDIR) $(INSTALLDOCDIR) $(INSTALLMANDIR))
51 $(INSTALL) $(TARGET) $(INSTALLBINDIR)
52 $(CP) $(DOCFILES) $(INSTALLDOCDIR)
53 gzip -9 $(INSTALLDOCDIR)/changelog
54 $(CP) $(MANUAL) $(INSTALLMANDIR)
55 chmod 644 $(INSTALLDOCDIR)/* $(INSTALLMANDIR)/*
56
57 uninstall:
58 rm -rf $(INSTALLBINDIR)/$(TARGET) $(INSTALLDOCDIR) $(INSTALLMANDIR)/$(MANUAL)
59
60
61 ##########
62 # PACKAGES:
63 ##########
64 SVN=svn
65 #REMOTESRCDIR = https://pdfsandwich.svn.sourceforge.net/svnroot/pdfsandwich/trunk/src
66 REMOTESRCDIR = https://svn.code.sf.net/p/pdfsandwich/code/trunk/src
67 PACKAGE := $(TARGET)-$(VERSION)
68 bz2: $(PACKAGE).tar.bz2
69
70 # source package:
71 $(PACKAGE).tar.bz2:
72 # "clean" checkout (unversioned):
73 $(SVN) export $(REMOTESRCDIR) $(PACKAGE)
74 tar -cjf $@ $(PACKAGE)
75 rm -rf $(PACKAGE)
76
77 # MacOS X Macport:
78 Portfile: $(PACKAGE).tar.bz2 pdfsandwich_version
79 ./make_portfile.pl $< > $@
80
81 ###### deb (Ubuntu)
82
83 ARCHITECTURE := $(shell uname -a|perl -e 'while(<>) {print /x86_64/ ? "amd64" : "i386";}')
84 DEBPACKAGE := $(TARGET)_$(VERSION)_$(ARCHITECTURE)
85 DEBDOCDIR = $(DEBPACKAGE)/usr/share/doc/$(TARGET)
86
87 deb: control md5sums
88 mkdir -p $(DEBPACKAGE)/DEBIAN
89 cp $^ $(DEBPACKAGE)/DEBIAN
90 fakeroot dpkg -b $(DEBPACKAGE)/ .
91
92 $(DEBPACKAGE): all
93 $(MAKE) PREFIX=$@/usr install
94 ./changelog2deb.pl changelog | gzip -9 > $(DEBDOCDIR)/changelog.Debian.gz
95 chmod 644 $(DEBDOCDIR)/changelog.Debian.gz
96
97 md5sums: $(DEBPACKAGE)
98 cd $< && find * -type f -exec md5sum {} \; > ../md5sums
99 chmod 644 md5sums
100
101 control: $(DEBPACKAGE)
102 ./make_control.pl $< > $@
103
104 clean:
105 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so depend $(TARGET)
106 rm -f pdfsandwich_version.ml $(MANUAL)
107 rm -rf $(PACKAGE) $(PACKAGE).tar.bz2 $(DEBPACKAGE) $(DEBPACKAGE).deb
108