2013-03-24 06:12:25 +04: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-07 07:23:06 +04:00
|
|
|
TestCustomHeap.cpp \
|
2013-03-24 06:13:24 +04:00
|
|
|
TestMustOverride.cpp \
|
2013-05-28 01:05:02 +04:00
|
|
|
TestNonHeapClass.cpp \
|
2013-04-12 07:20:02 +04:00
|
|
|
TestStackClass.cpp \
|
2013-03-24 06:12:25 +04: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-12 07:20:02 +04:00
|
|
|
$(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $(OBJS) -lclangASTMatchers
|
2013-03-24 06:12:25 +04: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-06 05:09:52 +04:00
|
|
|
|
2013-10-12 05:07:13 +04:00
|
|
|
compile libs export tools: all
|
2013-09-06 08:30:47 +04:00
|
|
|
|
|
|
|
distclean clean:
|
|
|
|
rm -f $(OBJS) $(TESTS) $(PLUGIN)
|
|
|
|
|
|
|
|
check:
|
|
|
|
|
2013-10-12 05:07:13 +04:00
|
|
|
libs: binaries
|
|
|
|
|
|
|
|
binaries: all
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
.PHONY: compile libs export tools distclean clean check
|