forked from rofirrim/gcc-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.common
More file actions
35 lines (24 loc) · 725 Bytes
/
Makefile.common
File metadata and controls
35 lines (24 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Common makefile to be included from all other makefiles
# Where we installed gcc and its headers
INSTALLDIR=/home/roger/soft/gcc/gcc-5.2
CC=$(INSTALLDIR)/bin/gcc
CXX=$(INSTALLDIR)/bin/g++
PLUGINDIR=$(shell $(CC) -print-file-name=plugin)
CXXFLAGS=-std=gnu++11 -fPIC -Wall -g -fno-rtti -I$(PLUGINDIR)/include
# This is a side effect of using C++11
CXXFLAGS+=-Wno-literal-suffix
LDFLAGS=
LDADD=
END=
OBJECTS=$(patsubst %.cc,%.o,$(SOURCES))
all: $(PLUGIN)
$(PLUGIN): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ -shared $+ $(LDADD)
%.o: %.cc
$(CXX) -c -o $@ $(CXXFLAGS) $<
PLUGINFLAG=-fplugin=./$(PLUGIN)
CCPLUGIN=$(CC) $(PLUGINFLAG)
CXXPLUGIN=$(CXX) $(PLUGINFLAG)
.PHONY: all clean test
clean:
rm -f $(OBJECTS) $(PLUGIN)