summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: f2ab4fc8ebcc580991efa28cbd32af60a781b06b (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
41
42
43
44
45
46
47
48
49
50
OBJECTS = typeinfo.o exception.o dynamic_cast.o terminate.o guard.o \
          stdexcept.o memory.o aux.o libelftc_dem_gnu3.o libelftc_vstr.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

all: libcxxabi.so.1 libcxxabi.a

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

libcxxabi.a: $(OBJECTS)
	@ar cr libcxxabi.a $(OBJECTS)


.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
stdexcept.o: stdexcept.cc stdexcept.h
memory.o: memory.cc stdexcept.h
aux.o: aux.cc stdexcept.h