diff options
author | Marco Peereboom <marco@conformal.com> | 2011-10-10 22:14:23 -0500 |
---|---|---|
committer | Marco Peereboom <marco@conformal.com> | 2011-10-10 22:14:23 -0500 |
commit | 62ea09e517d8c76152940b4250e692752a864128 (patch) | |
tree | 39c6eb7b154c1ca5a87fafd5d170359ad294855f /Makefile | |
parent | ef3480bac0642dd2ee2e2564e62da46cca77d1a2 (diff) | |
download | xombrero-62ea09e517d8c76152940b4250e692752a864128.tar.gz |
Add clang targets
Not quite perfect but good enough to use clang when not defined in mk.conf and to start the static analyzer. Work done by davec.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Makefile b/Makefile index 4242a50..a2ffb8d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -# $xxxterm$ - PREFIX?=/usr/local BINDIR=${PREFIX}/bin @@ -7,7 +5,7 @@ PROG=xxxterm MAN=xxxterm.1 SRCS= xxxterm.c marco.c -COPT+= -O2 +CFLAGS+= -O2 DEBUG= -ggdb3 LDADD= -lutil LIBS+= gtk+-2.0 @@ -17,14 +15,13 @@ LIBS+= gnutls LIBS+= gthread-2.0 GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) -CFLAGS+= $(GTK_CFLAGS) -Wall -pthread -LDFLAGS+= $(GTK_LDFLAGS) -pthread +CFLAGS+= $(GTK_CFLAGS) -Wall +LDFLAGS+= $(GTK_LDFLAGS) BUILDVERSION != sh "${.CURDIR}/buildver.sh" .if !${BUILDVERSION} == "" CPPFLAGS+= -DXXXTERM_BUILDSTR=\"$(BUILDVERSION)\" .endif - MANDIR= ${PREFIX}/man/man CLEANFILES += ${.CURDIR}/javascript.h xxxterm.cat1 xxxterm.core @@ -44,5 +41,19 @@ beforeinstall: ${PROG} ${OBJS} beforedepend: ${.CURDIR}/javascript.h -.include <bsd.prog.mk> +# clang targets +.if ${.TARGETS:M*analyze*} +CC=clang +CXX=clang++ +CPP=clang -E +CFLAGS+=--analyze +.elif ${.TARGETS:M*clang*} +CC=clang +CXX=clang++ +CPP=clang -E +.endif + +analyze: all +clang: all +.include <bsd.prog.mk> |