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
|
LANG=C
UNAME := $(shell uname)
PREFIX= /usr
PREFIX= $(DESTDIR)/usr
BIN= $(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
INSTALL=install
RC=/etc/rc.local
.SUFFIXES: .1 .1in
ifeq ($(UNAME),Darwin)
all: osx-hplj-hotplug
else
all:
endif
osx-hplj-hotplug: osx-hplj-hotplug.o
gcc osx-hplj-hotplug.o -o $@ \
-framework IOKit \
-framework Foundation \
-framework CoreFoundation
man: osx-hplj-hotplug.1
.1in.1:
-rm -f $*.1
MODver=$(VERSION); \
../includer-man -v DEF1=$(OLDGROFF) $*.1in | sed > $*.1 \
-e "s@\$${URLOAK}@$(URLOAK)@" \
-e "s@\$${URLZJS}@$(URLZJS)@" \
-e "s@\$${URLHP}@$(URLHP)@" \
-e "s@\$${URLXQX}@$(URLXQX)@" \
-e "s@\$${URLLAVA}@$(URLLAVA)@" \
-e "s@\$${URLQPDL}@$(URLQPDL)@" \
-e "s@\$${URLSLX}@$(URLSLX)@" \
-e "s@\$${URLHC}@$(URLHC)@" \
-e "s/\$${MODver}/$$MODver/"
chmod a-w $*.1
install: all
$(INSTALL) -c osx-hplj-hotplug $(BIN)/
install-hotplug:
$(INSTALL) -c local.localhost.startup.plist /Library/LaunchDaemons/
( \
echo "g/osx-hplj-hotplug/d"; \
echo "\$$a"; \
echo "# BEGIN osx-hplj-hotplug from foo2zjs"; \
echo " killall osx-hplj-hotplug"; \
echo " osx-hplj-hotplug >/tmp/osx-hplj-hotplug 2>&1 &"; \
echo "# END osx-hplj-hotplug from foo2zjs"; \
echo "."; \
echo "w"; \
) | ex $(RC)
chmod +x $(RC)
-killall osx-hplj-hotplug
nohup osx-hplj-hotplug >/tmp/osx-hplj-hotplug 2>&1 &
install-man: man
$(INSTALL) -d -m 755 $(MANDIR)
$(INSTALL) -d -m 755 $(MANDIR)/man1/
$(INSTALL) -c -m 644 osx-hplj-hotplug.1 $(MANDIR)/man1/
clean:
rm -f *.o *.1
uninstall:
( \
echo "g/osx-hplj-hotplug/d"; \
echo "w"; \
) | ex $(RC)
-rm -f $(BIN)/osx-hplj-hotplug
|