]> git.saurik.com Git - apple/system_cmds.git/blame - dirhelper.tproj/Makefile
system_cmds-431.tar.gz
[apple/system_cmds.git] / dirhelper.tproj / Makefile
CommitLineData
34d340d7
A
1
2ifeq "$(SRCROOT)" ""
3 SRCROOT=$(shell pwd)
4endif
5ifeq "$(OBJROOT)" ""
6 OBJROOT=$(shell pwd)
7endif
8ifeq "$(SYMROOT)" ""
9 SYMROOT=$(shell pwd)
10endif
11ifeq "$(DSTROOT)" ""
12 DSTROOT=
13endif
14
15ifneq "$(shell basename $(SRCROOT))" "dirhelper.tproj"
16SRCDIR=$(SRCROOT)/dirhelper.tproj
17else
18SRCDIR=$(SRCROOT)
19endif
20OBJDIR=$(OBJROOT)/dirhelper.obj
21
22CFLAGS = -g -mdynamic-no-pic -Os -Wall -Wextra -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 $(RC_CFLAGS) -I $(OBJDIR)
23
24LDFLAGS = -lbsm
25
26all: dirhelper
27
28dirhelper: mighdrs
29 cc -c $(CFLAGS) -o $(OBJDIR)/dirhelperServer.o $(OBJDIR)/dirhelperServer.c
30 cc -c $(CFLAGS) -o $(OBJDIR)/dirhelperUser.o $(OBJDIR)/dirhelperUser.c
31 cc -c $(CFLAGS) -o $(OBJDIR)/dirhelper.o $(SRCDIR)/dirhelper.c
32 cc $(CFLAGS) $(LDFLAGS) -o $(SYMROOT)/dirhelper $(OBJDIR)/dirhelperServer.o $(OBJDIR)/dirhelperUser.o $(OBJDIR)/dirhelper.o
33
34client: mighdrs
35 cc $(CFLAGS) $(LDFLAGS) -o $(SYMROOT)/client $(SRCDIR)/client.c $(OBJDIR)/dirhelperUser.c
36
37install: dirhelper
38 install -m 0644 -o root -g wheel -d $(DSTROOT)/System/Library/LaunchDaemons
39 install -m 0644 -o root -g wheel com.apple.bsd.dirhelper.plist $(DSTROOT)/System/Library/LaunchDaemons/
40 install -m 0755 -o root -g wheel -d $(DSTROOT)/usr/libexec
41 install -m 0755 -o root -g wheel $(SYMROOT)/dirhelper $(DSTROOT)/usr/libexec/
42 strip -S $(DSTROOT)/usr/libexec/dirhelper
43 mkdir -p "$(DSTROOT)/usr/share/man/man8"
44 gzip -c "$(SRCDIR)/dirhelper.8" > "$(DSTROOT)/usr/share/man/man8/dirhelper.8.gz"
45
46installsrc:
47 mkdir "$(SRCDIR)"
48 tar cf - . | tar xf - -C "$(SRCDIR)"
49
50mighdrs:
51 mkdir -p $(OBJDIR)
52 cd $(OBJDIR) && mig -sheader dirhelperServer.h /usr/local/include/dirhelper.defs
53
54installhdrs:
55 @echo nothing to install
56
57#installhdrs: mighdrs
58# install -m 0755 -o root -g wheel -d $(DSTROOT)/usr/local/include
59# install -m 0644 -o root -g wheel $(OBJDIR)/dirhelper.h $(DSTROOT)/usr/local/include/
60
61clean:
62 -rm -f *.o client dirhelper
63 -rm -rf dirhelper.obj