2 # Makefile for copyfile
9 #lazy_install_source:: shadow_source
11 include $(MAKEFILEPATH)/CoreOS/ReleaseControl/Common.make
18 LIB_DIR = $(DSTROOT)/usr/local/lib/system
19 MAN_DIR = $(DSTROOT)/usr/share/man/man3
20 INC_DIR = $(DSTROOT)/usr/include
22 WFLAGS= -Wno-trigraphs -Wmissing-prototypes -Wreturn-type -Wformat \
23 -Wmissing-braces -Wparentheses -Wswitch -Wunused-function \
24 -Wunused-label -Wunused-variable -Wunused-value -Wshadow \
25 -Wsign-compare -Wall -Wextra -Wpointer-arith -Wreturn-type \
26 -Wwrite-strings -Wcast-align -Wbad-function-cast \
27 -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls \
28 -Wno-parentheses -Wformat=2 -Wimplicit-function-declaration \
29 -Wshorten-64-to-32 -Wformat-security
31 CFLAGS += -D__DARWIN_NON_CANCELABLE=1 $(WFLAGS)
33 VERSOBJ= $(OBJROOT)/__version.o
36 LIBS = $(SYMROOT)/libcopyfile.a $(SYMROOT)/libcopyfile_profile.a $(SYMROOT)/libcopyfile_debug.a
39 install -d -m 755 $(INC_DIR)
40 install -c -m 444 $(SRCROOT)/copyfile.h $(INC_DIR)
43 install -d -m 755 $(MAN_DIR)
44 install -c -m 644 $(SRCROOT)/copyfile.3 $(MAN_DIR)
45 for a in fcopyfile copyfile_state_alloc copyfile_state_free \
46 copyfile_state_get copyfile_state_set ; do \
47 ln $(MAN_DIR)/copyfile.3 $(MAN_DIR)/$$a.3 ; \
49 install -d -m 755 $(LIB_DIR)
50 install -c -m 644 $(LIBS) $(LIB_DIR)
51 install -d -m 755 $(INC_DIR)
52 install -c -m 444 $(SRCROOT)/copyfile.h $(INC_DIR)
54 $(OBJROOT)/__version.c:
55 /Developer/Makefiles/bin/version.pl $(Project) > $@
57 $(VERSOBJ): $(OBJROOT)/__version.c
58 $(CC) -c -Os $(CFLAGS) $(RC_CFLAGS) -o $@ $^
60 $(OBJROOT)/%.o: $(SRCROOT)/%.c
61 $(CC) -c -Os $(CFLAGS) $(RC_CFLAGS) -o $@ $^
63 $(OBJROOT)/%-profile.o: $(SRCROOT)/%.c
64 $(CC) -c -pg $(CFLAGS) $(RC_CFLAGS) -o $@ $^
66 $(OBJROOT)/%-debug.o: $(SRCROOT)/%.c
67 $(CC) -c -g $(CFLAGS) $(RC_CFLAGS) -o $@ $^
69 $(SYMROOT)/libcopyfile.a:: $(OBJROOT)/$(OBJ) $(VERSOBJ)
70 libtool -static -o $@ $^
72 $(SYMROOT)/libcopyfile_profile.a:: $(OBJROOT)/copyfile-profile.o $(VERSOBJ)
73 libtool -static -o $@ $^
75 $(SYMROOT)/libcopyfile.a:: $(OBJROOT)/$(OBJ) $(VERSOBJ)
76 libtool -static -o $@ $^
78 $(SYMROOT)/libcopyfile_debug.a:: $(OBJROOT)/copyfile-debug.o $(VERSOBJ)
79 libtool -static -o $@ $^