OLD | NEW |
| (Empty) |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 # Makefile to build the PPAPI Clang plugins | |
6 | |
7 .PHONY: all clean | |
8 | |
9 PLUGINS = PrintNamesAndSizes FindAffectedInterfaces | |
10 | |
11 all: $(foreach plugin,$(PLUGINS),$(plugin)) | |
12 | |
13 clean: $(foreach plugin,$(PLUGINS),clean_$(plugin)) | |
14 | |
15 # This makefile assumes that you checked out llvm in a subdirectory of your | |
16 # home directory called 'llvm'. The source of llvm itself should be one level | |
17 # deeper at ~/llvm/llvm. It also assumes that you also have the clang component | |
18 # of llvm installed. | |
19 # It further assumes that clang has been built in Debug mode following the | |
20 # usual instructions, with a build directory parallel to the llvm directory. | |
21 # See instructions here: http://clang.llvm.org/get_started.html | |
22 # If you didn't configure Clang this way, you can set environment variables | |
23 # appropriately to work with your configuration of Clang and LLVM. | |
24 LLVM_ROOT ?= ~/llvm | |
25 LLVM_SOURCE_ROOT ?= $(LLVM_ROOT)/llvm | |
26 LLVM_BUILD_ROOT?=$(LLVM_ROOT)/build | |
27 LLVM_INCLUDES?=-I$(LLVM_BUILD_ROOT)/include -I$(LLVM_SOURCE_ROOT)/include | |
28 LLVM_LIB_PATHS?=-L$(LLVM_BUILD_ROOT)/Debug+Asserts/lib | |
29 | |
30 CLANG_ROOT=$(LLVM_SOURCE_ROOT)/tools/clang | |
31 CLANG_BUILD_ROOT=$(LLVM_BUILD_ROOT)/tools/clang | |
32 CLANG_INCLUDES=-I$(CLANG_ROOT)/include -I$(CLANG_BUILD_ROOT)/include | |
33 | |
34 INCLUDES=$(LLVM_INCLUDES) $(CLANG_INCLUDES) -I. | |
35 | |
36 CLANG_DEFINITIONS=-D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT
_MACROS | |
37 | |
38 COMMON_CCFLAGS=-fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual
-fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Ww
rite-strings | |
39 | |
40 CCFLAGS=$(INCLUDES) $(CLANG_DEFINITIONS) $(COMMON_CCFLAGS) -O2 | |
41 LDFLAGS = -Wl,-R $(LLVM_LIB_PATHS) -lpthread -ldl -lm -shared | |
42 | |
43 CPP=g++ | |
44 | |
45 %.o: %.cc | |
46 $(CPP) $(CCFLAGS) -c -o $@ $< | |
47 | |
48 PRINT_NAMES_AND_SIZES_OBJECTS=print_names_and_sizes.o | |
49 | |
50 PrintNamesAndSizes: $(PRINT_NAMES_AND_SIZES_OBJECTS) | |
51 $(CPP) $^ $(LDFLAGS) -o libPrintNamesAndSizes.so | |
52 | |
53 clean_PrintNamesAndSizes: | |
54 rm -f $(PRINT_NAMES_AND_SIZES_OBJECTS) libPrintNamesAndSizes.so | |
55 | |
56 FIND_AFFECTED_INTERFACES_OBJECTS=find_affected_interfaces.o | |
57 | |
58 FindAffectedInterfaces: $(FIND_AFFECTED_INTERFACES_OBJECTS) | |
59 $(CPP) $^ $(LDFLAGS) -o libFindAffectedInterfaces.so | |
60 | |
61 clean_FindAffectedInterfaces: | |
62 rm -f $(FIND_AFFECTED_INTERFACES_OBJECTS) libFindAffectedInterfaces.so | |
63 | |
64 | |
OLD | NEW |