3 INSTALL_PREFIX ?
= $(DESTDIR
)
4 INSTALL_PREFIX ?
= $(HOME
)
7 CC
:= $(CROSS_COMPILE
)$(CC
)
8 LD
:= $(CROSS_COMPILE
)$(LD
)
10 CFLAGS
:= -Wall
-W
-g
-O2
-I.
-Iinclude
/ -Wimplicit
-D_FORTIFY_SOURCE
=2 -D_GNU_SOURCE
12 CFLAGS
+= --sysroot
=$(SYSROOT
)
14 #CFLAGS += $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-m32"; fi)
15 CFLAGS
+= -Wdeclaration-after-statement
18 CFLAGS
+= -Wlogical-op
19 CFLAGS
+= -Wnested-externs
22 CFLAGS
+= -Wstrict-aliasing
=3
23 CFLAGS
+= -Wswitch-default
24 CFLAGS
+= -Wswitch-enum
26 CFLAGS
+= -Wwrite-strings
27 CFLAGS
+= -Wstrict-prototypes
-Wmissing-prototypes
29 # Only enabled during development.
34 QUIET_CC
= $(Q
:@
=@echo
' CC '$@
;)
40 @if
[ ! -f config.h
]; then echo
"\e[1;31mRun configure.sh first.\e[0m" ; exit
; fi
43 MACHINE
= $(shell $(CC
) -dumpmachine
)
44 SYSCALLS_ARCH
= $(shell case
"$(MACHINE)" in \
45 (sh
*) echo syscalls
/sh
/*.c
;; \
46 (ia64
*) echo syscalls
/ia64
/*.c
;; \
49 HEADERS
= $(patsubst %.h
,%.h
,$(wildcard *.h
)) $(patsubst %.h
,%.h
,$(wildcard syscalls
/*.h
)) $(patsubst %.h
,%.h
,$(wildcard ioctls
/*.h
))
51 SRCS
= $(wildcard *.c
) \
52 $(wildcard children
/*.c
) \
53 $(wildcard ioctls
/*.c
) \
55 $(wildcard syscalls
/*.c
) \
58 OBJS
= $(sort $(patsubst %.c
,%.o
,$(wildcard *.c
))) \
59 $(sort $(patsubst %.c
,%.o
,$(wildcard children
/*.c
))) \
60 $(sort $(patsubst %.c
,%.o
,$(wildcard ioctls
/*.c
))) \
61 $(sort $(patsubst %.c
,%.o
,$(wildcard net
/*.c
))) \
62 $(sort $(patsubst %.c
,%.o
,$(wildcard syscalls
/*.c
))) \
63 $(sort $(patsubst %.c
,%.o
,$(SYSCALLS_ARCH
)))
67 -include $(SRCS
:%.c
=$(DEPDIR
)/%.d
)
69 trinity
: test $(OBJS
) $(HEADERS
)
70 $(QUIET_CC
)$(CC
) $(CFLAGS
) -o trinity
$(OBJS
)
73 df
= $(DEPDIR
)/$(*D
)/$(*F
)
76 $(QUIET_CC
)$(CC
) $(CFLAGS
) -o
$@
-c
$<
77 @mkdir
-p
$(DEPDIR
)/$(*D
)
78 @gcc
-MM
$(CFLAGS
) $*.c
> $(df
).d
79 @mv
-f
$(df
).d
$(df
).d.tmp
80 @sed
-e
's|.*:|$*.o:|' <$(df
).d.tmp
> $(df
).d
81 @sed
-e
's/.*://' -e
's/\\$$//' < $(df
).d.tmp | fmt
-1 | \
82 sed
-e
's/^ *//' -e
's/$$/:/' >> $(df
).d
93 @perl
-p
-i
-e
's/^#CFLAGS \+\= -Werror/CFLAGS += -Werror/' Makefile
94 @perl
-p
-i
-e
's/DEVEL=0/DEVEL=1/' configure.sh
95 git commit Makefile
-m
"Enable -Werror"
98 @perl
-p
-i
-e
's/^CFLAGS \+\= -Werror/#CFLAGS += -Werror/' Makefile
99 @perl
-p
-i
-e
's/DEVEL=1/DEVEL=0/' configure.sh
100 git commit Makefile
-m
"Disable -Werror"
103 git tag
-a
$(VERSION
) -m
"$(VERSION) release."
108 git archive
--format
=tar.gz
--prefix=trinity-
$(VERSION
)/ HEAD
> trinity-
$(VERSION
).tgz
111 install -d
-m
755 $(INSTALL_PREFIX
)/bin
112 install trinity
$(INSTALL_PREFIX
)/bin
115 @ctags
-R
--exclude
=tmp
118 @git push
--mirror git@github.com
:kernelslacker
/trinity.git
121 scan-build
--use-analyzer
=/usr
/bin
/clang make
124 rm -rf cov-int trinity-coverity.tgz
125 cov-build
--dir cov-int make
126 tar czvf trinity-coverity.tgz cov-int