2013-03-23 19:12:25 -07:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
CXX := @CXX@
|
|
|
|
CXXFLAGS := @CXXFLAGS@
|
|
|
|
LDFLAGS := @LDFLAGS@
|
|
|
|
VPATH := @srcdir@
|
|
|
|
|
|
|
|
# Helper for end
|
|
|
|
NULL :=
|
|
|
|
|
|
|
|
CPPSRCS := \
|
|
|
|
clang-plugin.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
TESTSRCS := \
|
2013-12-06 19:23:06 -08:00
|
|
|
TestCustomHeap.cpp \
|
2013-03-23 19:13:24 -07:00
|
|
|
TestMustOverride.cpp \
|
2013-05-27 14:05:02 -07:00
|
|
|
TestNonHeapClass.cpp \
|
2013-04-11 20:20:02 -07:00
|
|
|
TestStackClass.cpp \
|
2013-03-23 19:12:25 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
OBJS := $(patsubst %.cpp,%.o,$(CPPSRCS))
|
|
|
|
TESTS := $(patsubst %.cpp,test-%,$(TESTSRCS))
|
|
|
|
|
|
|
|
PLUGIN := libclang-plugin.so
|
|
|
|
|
|
|
|
all: $(PLUGIN) $(TESTS)
|
|
|
|
|
|
|
|
$(OBJS): %.o: %.cpp Makefile
|
|
|
|
$(CXX) -o $@ -c $(CXXFLAGS) $<
|
|
|
|
|
|
|
|
$(PLUGIN): $(OBJS)
|
|
|
|
rm -f $@
|
2013-04-11 20:20:02 -07:00
|
|
|
$(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $(OBJS) -lclangASTMatchers
|
2013-03-23 19:12:25 -07:00
|
|
|
|
|
|
|
TESTFLAGS := -fsyntax-only -Xclang -verify \
|
|
|
|
-Xclang -load -Xclang $(CURDIR)/$(PLUGIN) \
|
|
|
|
-Xclang -add-plugin -Xclang moz-check
|
|
|
|
|
|
|
|
$(TESTS): test-%: tests/%.cpp $(PLUGIN)
|
|
|
|
$(CXX) $(TESTFLAGS) $<
|
2013-09-05 18:09:52 -07:00
|
|
|
|
2013-10-11 18:07:13 -07:00
|
|
|
compile libs export tools: all
|
2013-09-05 21:30:47 -07:00
|
|
|
|
|
|
|
distclean clean:
|
|
|
|
rm -f $(OBJS) $(TESTS) $(PLUGIN)
|
|
|
|
|
|
|
|
check:
|
|
|
|
|
2013-10-11 18:07:13 -07:00
|
|
|
libs: binaries
|
|
|
|
|
|
|
|
binaries: all
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
.PHONY: compile libs export tools distclean clean check
|