forked from moretension/duti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
153 lines (126 loc) · 3.99 KB
/
Makefile.in
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
SHELL = /bin/sh
srcdir = @srcdir@
VPATH = @srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
datadir=@datadir@
BINDIR=@bindir@
MANDIR=@mandir@
DUTI_BUILD_DATE=@build_date@
CC= @CC@
FRAMEWORKS= -framework ApplicationServices -framework CoreFoundation
OPTOPTS= -isysroot @macosx_sdk@ \
@macosx_arches@ \
-mmacosx-version-min=@macosx_dep_target@ \
@OPTOPTS@
LIBS= @LIBS@
LDFLAGS= @LDFLAGS@ ${LIBS}
CFLAGS= ${OPTOPTS} @CFLAGS@
INSTALL= @INSTALL@
TARGETS= duti
MAN1TARGETS= duti.1
MANTARGETS= ${MAN1TARGETS}
DUTI_OBJ= version.o util.o plist.o handler.o duti.o
all : ${TARGETS}
version.o : version.c
${CC} ${CFLAGS} -c ${srcdir}/version.c
duti.o : duti.c
${CC} ${CFLAGS} -c ${srcdir}/duti.c
handler.o : handler.c
${CC} ${CFLAGS} -c ${srcdir}/handler.c
plist.o : plist.c
${CC} ${CFLAGS} -c ${srcdir}/plist.c
util.o : util.c
${CC} ${CFLAGS} -c ${srcdir}/util.c
duti : ${DUTI_OBJ}
${CC} ${FRAMEWORKS} ${CFLAGS} -o duti ${DUTI_OBJ} ${LDFLAGS}
VERSION=$(shell date +%Y%m%d)
DISTDIR=duti-${VERSION}
dist : distclean
mkdir ../${DISTDIR}
tar -h -c -f - -X EXCLUDE . | tar xpf - -C ../${DISTDIR}
echo ${VERSION} > ../${DISTDIR}/VERSION
sed -e "s@INTERNAL@${VERSION}@" \
< configure.ac > ../${DISTDIR}/configure.ac
(cd "../${DISTDIR}"; autoconf; rm -rf autom4te.cache)
for i in ${MANTARGETS}; do \
sed -e 's@_DUTI_BUILD_DATE@${DUTI_BUILD_DATE}@g' \
../${DISTDIR}/$$i > ../${DISTDIR}/$$i.tmp; \
mv -f ../${DISTDIR}/$$i.tmp ../${DISTDIR}/$$i; \
done
(cd .. && tar cvfz ${DISTDIR}.tar.gz ${DISTDIR})
for c in sha1 rmd160 md5; do \
(cd .. && openssl $$c ${DISTDIR}.tar.gz); \
done
install : all
-mkdir -p ${DESTDIR}${BINDIR}
${INSTALL} -m 0755 -c ${TARGETS} ${DESTDIR}${BINDIR}/
-mkdir -p ${DESTDIR}${MANDIR}/man1
${INSTALL} -m 0644 -c ${MAN1TARGETS} ${DESTDIR}${MANDIR}/man1/
PKGNAME= duti-${VERSION}
PKGDIR= tmp/duti-installer
PKGRSRC= $(wildcard pkg-resources/*.rtf)
PKGINFODIR= tmp/Info
PKGINFO= pkg-resources/Description.plist pkg-resources/Info.plist
DEVUTILS= /Developer/Applications/Utilities
PKGMKR= ${DEVUTILS}/PackageMaker.app/Contents/MacOS/packagemaker
packageroot : all
-mkdir -p -m 0755 ${PKGDIR}/${BINDIR}
for i in ${TARGETS}; do \
${INSTALL} -m 0755 -c $$i ${PKGDIR}/${BINDIR}/; \
done
-mkdir -p -m 0755 ${PKGDIR}/${MANDIR}
-mkdir -p -m 0755 ${PKGDIR}/${MANDIR}/man1
for i in ${MANTARGETS}; do \
${INSTALL} -m 0644 $$i ${PKGDIR}/${MANDIR}/man1/; \
sed -e 's@_DUTI_BUILD_DATE@${DUTI_BUILD_DATE}@g' \
${PKGDIR}/${MANDIR}/man1/$$i > \
${PKGDIR}/${MANDIR}/man1/$$i.tmp; \
mv -f ${PKGDIR}/${MANDIR}/man1/$$i.tmp \
${PKGDIR}/${MANDIR}/man1/$$i; \
done
-mkdir -p -m 0755 ${PKGINFODIR}
for i in ${PKGINFO}; do \
sed -e 's@_DUTI_VERSION@${VERSION}@g' $$i \
> ${PKGINFODIR}/`basename $$i`; \
done
for i in ${PKGRSRC}; do \
${INSTALL} -m 0644 -c $$i ${PKGINFODIR}/`basename $$i`; \
done
sudo chown -R root:wheel ${PKGDIR}
sudo chgrp admin ${PKGDIR}
pkgmaker : packageroot
${PKGMKR} -build -p ../${PKGNAME}.pkg \
-f ${PKGDIR} -r ${PKGINFODIR} \
-i ${PKGINFODIR}/Info.plist \
-d ${PKGINFODIR}/Description.plist
(cd .. && tar cvfz ${PKGNAME}.pkg.tar.gz ${PKGNAME}.pkg)
sudo rm -rf tmp
for c in sha1 rmd160 md5; do \
(cd ..; openssl $$c ${PKGNAME}.pkg.tar.gz); \
done
pkgbld : packageroot
pkgbuild --root ${PKGDIR} \
--identifier public-domain.mortensen.duti-installer \
--version ${VERSION} \
../${PKGNAME}.pkg
pkgbldsigned : pkgbld
/bin/mv ../${PKGNAME}.pkg ../${PKGNAME}-unsigned.pkg
productsign --timestamp --sign "${INST_KEY}" ../${PKGNAME}-unsigned.pkg ../${PKGNAME}.pkg
pkgcln :
(cd .. && tar cvfz ${PKGNAME}.pkg.tar.gz ${PKGNAME}.pkg)
sudo rm -rf tmp
for c in sha1 rmd160 md5; do \
(cd ..; openssl $$c ${PKGNAME}.pkg.tar.gz); \
done
pkg : pkgbld pkgcln
pkgsigned : pkgbldsigned pkgcln
clean :
rm -f *.o a.out core
rm -f ${TARGETS}
rm -rf tmp
distclean : clean
rm -f config.log config.status config.cache Makefile version.c
rm -rf autom4te.cache
rm -rf .#*