aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 0fb096652e2ded237fb05dc673cb1e71c29e6c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
GXX=g++-4.5
PLUGIN_INC := $(shell $(GXX) -print-file-name=plugin)

src := plugin.cxx
obj := $(src:.cxx=.o)

sunrise.so: $(obj)
	$(GXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS)

%.o: %.cxx
	$(GXX) -c -o $@ -fPIC $(CPPFLAGS) -I$(PLUGIN_INC)/include $(CXXFLAGS) $<

# Test.
#
.PHONY: test
test: sunrise.so test.cxx
	$(GXX) -x c++ -S -fplugin=./sunrise.so test.cxx

# Clean.
#
.PHONY: clean
clean:
	rm -f *.o sunrise.so