]>
Commit | Line | Data |
---|---|---|
34d340d7 A |
1 | |
2 | ifeq "$(SRCROOT)" "" | |
3 | SRCROOT=$(shell pwd) | |
4 | endif | |
5 | ifeq "$(OBJROOT)" "" | |
6 | OBJROOT=$(shell pwd) | |
7 | endif | |
8 | ifeq "$(SYMROOT)" "" | |
9 | SYMROOT=$(shell pwd) | |
10 | endif | |
11 | ifeq "$(DSTROOT)" "" | |
12 | DSTROOT= | |
13 | endif | |
14 | ||
15 | ifneq "$(shell basename $(SRCROOT))" "dirhelper.tproj" | |
16 | SRCDIR=$(SRCROOT)/dirhelper.tproj | |
17 | else | |
18 | SRCDIR=$(SRCROOT) | |
19 | endif | |
20 | OBJDIR=$(OBJROOT)/dirhelper.obj | |
21 | ||
22 | CFLAGS = -g -mdynamic-no-pic -Os -Wall -Wextra -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 $(RC_CFLAGS) -I $(OBJDIR) | |
23 | ||
24 | LDFLAGS = -lbsm | |
25 | ||
26 | all: dirhelper | |
27 | ||
28 | dirhelper: 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 | ||
34 | client: mighdrs | |
35 | cc $(CFLAGS) $(LDFLAGS) -o $(SYMROOT)/client $(SRCDIR)/client.c $(OBJDIR)/dirhelperUser.c | |
36 | ||
37 | install: 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 | ||
46 | installsrc: | |
47 | mkdir "$(SRCDIR)" | |
48 | tar cf - . | tar xf - -C "$(SRCDIR)" | |
49 | ||
50 | mighdrs: | |
51 | mkdir -p $(OBJDIR) | |
52 | cd $(OBJDIR) && mig -sheader dirhelperServer.h /usr/local/include/dirhelper.defs | |
53 | ||
54 | installhdrs: | |
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 | ||
61 | clean: | |
62 | -rm -f *.o client dirhelper | |
63 | -rm -rf dirhelper.obj |