1 | PREFIX = /usr/local |
---|
2 | VERSION = 1.2 |
---|
3 | |
---|
4 | CC = cc |
---|
5 | CFLAGS = -g -Wall -m32 |
---|
6 | LD = cc |
---|
7 | LDFLAGS = -framework ApplicationServices -m32 |
---|
8 | RM = /bin/rm -f |
---|
9 | SRC = Makefile pict2pdf.c |
---|
10 | DOC = README |
---|
11 | TEST = sample.pict sample.orig.pdf |
---|
12 | OBJS = pict2pdf.o |
---|
13 | PROG = pict2pdf |
---|
14 | MANPAGE = pict2pdf.1 |
---|
15 | DISTNAME = $(PROG)-$(VERSION) |
---|
16 | HTMLDOC = pict2pdf.html |
---|
17 | TEMPDMG = $(PROG).temp |
---|
18 | |
---|
19 | all: $(PROG) |
---|
20 | |
---|
21 | $(PROG): $(OBJS) |
---|
22 | $(LD) $(LDFLAGS) $(OBJS) -o $(PROG) |
---|
23 | |
---|
24 | html $(HTMLDOC): |
---|
25 | install -d $(PREFIX)/share/man/man1 |
---|
26 | install -m 0644 $(MANPAGE) $(PREFIX)/share/man/man1 |
---|
27 | man pict2pdf | man2html > /tmp/index.html |
---|
28 | perl -pe "s@(http.*f/)@<a href=\"\1\"> \1</a>@" /tmp/index.html > $(HTMLDOC) |
---|
29 | rm /tmp/index.html |
---|
30 | |
---|
31 | test: sample.pict $(PROG) |
---|
32 | ./$(PROG) -f -r 10 -s 0.75 sample.pict |
---|
33 | |
---|
34 | dmg: $(PROG) $(DOC) $(HTMLDOC) |
---|
35 | hdiutil create $(TEMPDMG) -sectors 9000 -fs HFS+ -volname $(PROG) |
---|
36 | hdiutil mount $(TEMPDMG).dmg |
---|
37 | cp $(PROG) /Volumes/$(PROG) |
---|
38 | cp $(DOC) /Volumes/$(PROG) |
---|
39 | cp $(HTMLDOC) /Volumes/$(PROG) |
---|
40 | hdiutil unmount /Volumes/$(PROG) |
---|
41 | hdiutil convert $(TEMPDMG).dmg -format UDCO -o $(DISTNAME).dmg |
---|
42 | rm $(TEMPDMG).dmg |
---|
43 | |
---|
44 | install: $(PROG) $(MANPAGES) |
---|
45 | install -d $(PREFIX)/bin |
---|
46 | install $(PROG) $(PREFIX)/bin |
---|
47 | install -d $(PREFIX)/share/man/man1 |
---|
48 | install -m 0644 $(MANPAGE) $(PREFIX)/share/man/man1 |
---|
49 | |
---|
50 | install-html: $(HTMLDOC) |
---|
51 | scp $(HTMLDOC) prahl@shell.sourceforge.net:/home/groups/p/pi/pict2pdf/htdocs/index.html |
---|
52 | |
---|
53 | dist: $(SRC) $(MANPAGES) $(DOC) $(TEST) |
---|
54 | mkdir $(DISTNAME) |
---|
55 | ln $(SRC) $(DISTNAME) |
---|
56 | ln $(DOC) $(DISTNAME) |
---|
57 | ln $(TEST) $(DISTNAME) |
---|
58 | ln $(MANPAGE) $(DISTNAME) |
---|
59 | tar cvf - $(DISTNAME) | gzip > $(DISTNAME).tar.gz |
---|
60 | rm -rf $(DISTNAME) |
---|
61 | |
---|
62 | clean: |
---|
63 | rm -rf $(PROG) $(OBJS) $(HTMLDOC) sample.pdf |
---|
64 | rm -rf $(DISTNAME) $(DISTNAME).tar.gz $(DISTNAME).dmg |
---|