-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
42 lines (34 loc) · 848 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
include ../common.mk
LIBS=$(shell if [ -e /usr/lib/libSystemStubs.a ]; then echo -lSystemStubs; fi)
###
### Variables for the 'install' phase
###
DATDIR:=$(DATDIR)/darwinbuild
override OBJROOT:=$(OBJROOT)/darwintrace~obj
all: darwintrace.dylib
VERSION=$(shell uname -r | cut -f1 -d. )
ifeq ($(VERSION), 8)
CFLAGS += -nostdlib
else
CFLAGS += -nodefaultlibs
endif
darwintrace.dylib: darwintrace.c
@mkdir -p $(OBJROOT)
cc -o $(OBJROOT)/$@ \
$(CFLAGS) \
-Wall -Werror -pedantic -std=c99 \
-flat_namespace \
-fno-common \
$(CFLAGS) \
-undefined suppress \
-dynamiclib \
$^ $(LIBS)
clean:
rm -rf $(OBJROOT)
install: all
[ -d $(DATDIR) ] || \
$(INSTALL) -d $(INSTALL_DIR_FLAGS) $(DATDIR)
$(INSTALL) $(INSTALL_DOC_FLAGS) $(OBJROOT)/darwintrace.dylib $(DATDIR)
uninstall:
rm -f $(DATDIR)/darwintrace.dylib
-rmdir $(DATDIR)