Skip to content

Instantly share code, notes, and snippets.

@agentzh
Created March 18, 2013 03:20
Show Gist options
  • Save agentzh/5184811 to your computer and use it in GitHub Desktop.
Save agentzh/5184811 to your computer and use it in GitHub Desktop.
The Makefile used to process my Nginx modules' source code via the clang static analyzer.
c_files=$(wildcard src/ngx_*.c)
plist_vfiles=$(patsubst src/%.c,%.plist,$(c_files))
#all: ; echo $(clang_vfiles)
.PHONY: clang
clang: $(plist_vfiles)
%.plist: src/%.c
@echo $<
-@clang -O --analyze -Wextra -Wall \
-Wno-unused-parameter -Wunused-function \
-Wunused-variable -Wunused-value -Werror \
-I/opt/pcre821jit/include -DNDK_SET_VAR \
-DNDK_UPSTREAM_LIST -DNDK_SET_VAR -I src/api \
-I nginx/src/core -I nginx/src/event -I nginx/src/event/modules \
-I nginx/src/os/unix \
-I ../ndk-nginx-module/objs \
-I nginx/objs/addon/ndk \
-I nginx/objs \
-I /usr/local/openresty-debug/luajit/include/luajit-2.0 \
-I /opt/drizzle/include/libdrizzle-1.0 \
-I objs -I nginx/src/http -I nginx/src/http/modules \
-I ../ndk-nginx-module/src -I nginx/src/mail \
$<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment