2018-04-26 19:16:01 +02:00
|
|
|
CXX=g++
|
|
|
|
CXXLIBS=-ldl
|
2018-04-27 17:31:53 +02:00
|
|
|
CXXFLAGS=-O2 -fPIC -Wall -Wextra
|
2018-04-26 19:16:01 +02:00
|
|
|
|
2018-05-02 14:34:05 +02:00
|
|
|
TARGET_BASE=libstack_walker
|
|
|
|
TARGETS=$(TARGET_BASE).global.so $(TARGET_BASE).per_func.so
|
2018-04-26 19:16:01 +02:00
|
|
|
OBJS=stack_walker.o
|
|
|
|
|
2018-05-02 14:34:05 +02:00
|
|
|
all: $(TARGETS)
|
2018-04-26 19:16:01 +02:00
|
|
|
|
2018-05-02 14:34:05 +02:00
|
|
|
$(TARGET_BASE).%.so: $(OBJS:.o=.%.o)
|
2018-04-26 19:16:01 +02:00
|
|
|
$(CXX) $(CXXFLAGS) -shared $< $(CXXLIBS) -o $@
|
|
|
|
|
2018-05-02 14:34:05 +02:00
|
|
|
%.global.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -DSGP_GLOBAL_SWITCH -c $< -o $@
|
|
|
|
|
|
|
|
%.per_func.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -DSGP_SWITCH_PER_FUNC -c $< -o $@
|
2018-04-26 19:16:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
2018-05-02 14:34:05 +02:00
|
|
|
rm -f $(OBJS) $(TARGET_BASE)*.so
|