7 CPPFLAGS = -I$(SRCROOT)
8 CFLAGS = -Os -g3 -no-cpp-precomp -Wall $(RC_CFLAGS) -isysroot $(SDKROOT)
9 LDFLAGS = $(RC_CFLAGS) -install_name /usr/lib/libutil.dylib -compatibility_version $(VERSION) \
10 -current_version $(VERSION) -lstdc++ -exported_symbols_list libutil.exports -isysroot $(SDKROOT)
24 LIB := libutil1.0.dylib
25 SRCS := _secure_path.c getmntopts.c humanize_number.c \
26 pidfile.c property.c realhostname.c trimdomain.c uucplock.c \
27 ExtentManager.cpp wipefs.cpp reexec_to_match_kernel.c
28 HDRS := libutil.h mntopts.h wipefs.h
29 MAN3 := _secure_path.3 getmntopts.3 humanize_number.3 pidfile.3 \
30 property.3 realhostname.3 realhostname_sa.3 trimdomain.3 \
31 uucplock.3 wipefs.3 reexec_to_match_kernel.3
34 .SUFFIXES : .c .cpp .h .o
37 .PHONY : all installsrc installhdrs install clean installlib installman
39 all : $(SYMROOT)/$(LIB)
45 @if test ! -d $(SRCROOT); then \
46 echo "$(INSTALL) -d $(SRCROOT)"; \
47 $(INSTALL) -d $(SRCROOT); \
49 tar cf - . | (cd $(SRCROOT); tar xpf -)
50 @for i in `find $(SRCROOT) | grep "/\.svn$$"`; do \
51 if test -d $$i ; then \
58 $(INSTALL) -d $(DSTROOT)/usr/local/include
59 $(INSTALL) -m 0644 $(HDRS) $(DSTROOT)/usr/local/include
62 install : installhdrs installlib strip installman install-plist
65 rm -f $(patsubst %.cpp,$(OBJROOT)/%.o,$(patsubst %.c,$(OBJROOT)/%.o,$(SRCS)))
68 rm -f $(SYMROOT)/$(LIB)
71 $(STRIP) -x -S $(DSTROOT)/usr/lib/$(LIB)
74 # Internal targets and rules.
76 installlib : $(SYMROOT)/$(LIB)
77 $(DSYMUTIL) $(SYMROOT)/$(LIB) -o $(SYMROOT)/$(LIB).dSYM
78 $(INSTALL) -d $(DSTROOT)/usr/lib
79 $(INSTALL) -m 0755 $< $(DSTROOT)/usr/lib
80 $(LN) -fs libutil1.0.dylib $(DSTROOT)/usr/lib/libutil.dylib
83 $(INSTALL) -d $(DSTROOT)/usr/local/share/man/man3
84 @for i in $(MAN3); do\
85 echo "$(INSTALL) -m 0444 $(SRCROOT)/$$i $(DSTROOT)/usr/local/share/man/man3/"; \
86 $(INSTALL) -m 0444 $(SRCROOT)/$$i $(DSTROOT)/usr/local/share/man/man3; \
89 $(OBJROOT)/%.o : $(SRCROOT)/%.c \
90 $(patsubst %.h,$(SRCROOT)/%.h,$(HDRS))
91 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
93 $(OBJROOT)/%.o : $(SRCROOT)/%.cpp \
94 $(patsubst %.h,$(SRCROOT)/%.h,$(HDRS))
95 $(CPP) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
97 $(SYMROOT)/$(LIB) : $(patsubst %.cpp,$(OBJROOT)/%.o,$(patsubst %.c,$(OBJROOT)/%.o,$(SRCS)))
98 $(CC) -dynamiclib $(LDFLAGS) -o $@ $(patsubst %.cpp,$(OBJROOT)/%.o,$(patsubst %.c,$(OBJROOT)/%.o,$(SRCS)))
100 OSV = $(DSTROOT)/usr/local/OpenSourceVersions
101 OSL = $(DSTROOT)/usr/local/OpenSourceLicenses
105 $(INSTALL) $(SRCROOT)/libutil.plist $(OSV)/
107 $(INSTALL) $(SRCROOT)/libutil.txt $(OSL)/