summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: d8240a76e6eb013a0f7ea398be5cdebca24f7e14 (plain)
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
36
37
38
39
40
OBJECTS = typeinfo.o exception.o dynamic_cast.o terminate.o guard.o

# Needed for building the shared library
CXXFLAGS = -fPIC
# Needed for GCC atomic ops to work on x86.
CXXFLAGS += -march=native
# This library implements exception handling, so make sure that the compiler
# emits the correct code
CXXFLAGS += -fexceptions 

# Useful flags for debugging
CXXFLAGS += -Wall -pedantic -g 

# silence warnings about LL suffix (only works with clang / recent GCC):
#CXXFLAGS += -std=c++0x

# Find the unwind.h header installed from ports
CPPFLAGS += -I/usr/local/include
LDFLAGS  += -L/usr/local/lib -L. -lpthread -fexceptions

PRODUCTS = libcxxabi.so.1

libcxxabi.so.1: $(OBJECTS)
	@echo Linking $@...
	@gcc -fexception -shared $(OBJECTS) $(LDFLAGS) -o libcxxabi.so.1 #-lunwind

.cc.o:
	@echo Compiling $<...
	@$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 

clean:
	@echo Cleaning...
	@rm -f $(OBJECTS) $(PRODUCTS) $(TEST_OBJECTS) vgcore* *.core


dynamic_cast.o: dynamic_cast.cc typeinfo.h abi_namespace.h typeinfo
exception.o: exception.cc typeinfo.h abi_namespace.h typeinfo dwarf_eh.h
guard.o: guard.cc
terminate.o: terminate.cc
typeinfo.o: typeinfo.cc typeinfo.h abi_namespace.h typeinfo