2 SDK
= -isysroot
$(SDKROOT
)
3 CC
= $(shell xcrun
-find
-sdk
$(SDKROOT
) cc)
4 DSYMUTIL
= $(shell xcrun
-find
-sdk
${SDKROOT} dsymutil
)
10 CFLAGS
= -g
$(OFLAG
) -Wall
-I
$(SRCROOT
)/..
/include $(SDK
)
11 LIBSTUFF
= -L
$(SYMROOT
)/..
/libstuff
-lstuff
12 MKDIRS
= /bin
/mkdir
-p
16 OFILE_DIR
= $(OBJROOT
)
20 MANDIR
= /usr
/share
/man
21 DSTDIRS
= $(DSTROOT
)$(BINDIR
) $(DSTROOT
)$(MANDIR
)/man1
$(DSTROOT
)$(MANDIR
)/man5
23 HFILES
= archive.h extern.h pathnames.h
24 CFILES
= append.c
ar.c archive.c contents.c delete.c extract.c misc.c move.c \
28 OBJS
= $(CFILES
:.c
=.o
)
29 INSTALL_FILES
= $(CFILES
) $(HFILES
) $(MAN1
) $(MAN5
) Makefile notes
33 all: $(OFILE_DIR
) $(SYMROOT
) $(PRODUCT
).NEW
35 $(PRODUCT
).NEW
: $(OFILE_DIR
) $(SYMROOT
) $(OBJS
)
36 $(CC
) $(RC_CFLAGS
) $(SDK
) -o
$(SYMROOT
)/$@
$(OBJS
) $(LIBSTUFF
)
37 $(DSYMUTIL
) $(SYMROOT
)/$@
40 $(CC
) $(CFLAGS
) $(RC_CFLAGS
) $(COPTS
) -c
-o
$(OFILE_DIR
)/$*.o
$<
43 -rm -f
$(SYMROOT
)/$(PRODUCT
).NEW
47 -cd
$(OFILE_DIR
); rm -f
$(OBJS
)
50 install: all $(DSTDIRS
)
51 install -c
-s
-m
555 $(SYMROOT
)/$(PRODUCT
).NEW \
52 $(DSTROOT
)$(BINDIR
)/$(PRODUCT
)
53 install -c
-m
444 $(MAN1
) $(DSTROOT
)$(MANDIR
)/man1
54 install -c
-m
444 $(MAN5
) $(DSTROOT
)$(MANDIR
)/man5
59 gnutar cf
- $(INSTALL_FILES
) |
(cd
$(SRCROOT
); gnutar xf
-)
60 chmod
444 $(SRCROOT
)/*
62 $(OFILE_DIR
) $(SYMROOT
) $(DSTDIRS
):