Remove auto-copy of documentation; the docs directory should be specified if at all.
[dyninst.git] / stackwalk / make.module.tmpl
1 # -*- makefile -*-
2 # Common makefile template for the dyninstAPI library.  This file is not
3 # intended to be a useful Makefile in isolation; instead, it should be
4 # included from within an architecture-specific Makefile.
5 #
6 # $Id: make.module.tmpl,v 1.1 2008/06/30 19:40:26 legendre Exp $
7 #
8
9 SUITE_NAME      = Stackwalker
10 RELEASE_MAJOR   = 8
11 RELEASE_MINOR = 1
12
13 USES_DWARF_DEBUG = true
14 USES_LIBELF = true
15
16 CFLAGS               += $(USEFULWARNINGS) $(DEFINES)
17 CXXFLAGS             += $(USEFULWARNINGS) $(DEFINES)
18
19 ifndef TARGET
20 ifdef STATIC_COMPS
21 STATIC_LIBRARY = true
22 TARGET = libstackwalk.a
23 else
24 TARGET = libstackwalk.so
25 endif
26 endif
27
28 LDFLAGS += -L$(TO_CORE)/common/$(PLATFORM)
29 ifndef USES_NATIVE_CC
30 LD              = $(GXX)
31 LDFLAGS         += -shared
32 CFLAGS          += 
33 CXXFLAGS        += 
34 else
35 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
36 LDFLAGS         += -G
37 endif #sparc
38 endif #USES_NATIVE
39 TFLAGS          +=
40
41 TO_INC     = ../h
42 PUBLIC_H   = basetypes.h \
43              framestepper.h \
44              steppergroup.h \
45              symlookup.h \
46              frame.h \
47              procstate.h \
48              swk_errors.h \
49              walker.h \
50                                  local_var.h \
51                                  sw_c.h
52
53 SRCS         += ../src/frame.C \
54                 ../src/framestepper.C \
55                 ../src/swk_errors.C \
56                 ../src/symlookup.C \
57                 ../src/walker.C \
58                 ../src/procstate.C \
59                 ../src/steppergroup.C \
60                 ../src/libstate.C \
61                 ../src/sw_c.C \
62                 ../src/sw_pcontrol.C
63
64 ifdef LIBDWARF_PLATFORM
65 LDFLAGS += -L../../dwarf/$(PLATFORM) -ldynDwarf
66 endif
67
68 ifdef LIBELF_PLATFORM
69 LDFLAGS += -L../../elf/$(PLATFORM) -ldynElf
70 endif
71
72 ifndef WITHOUT_PARSE_API
73         MYFLAGS += -I../../parseAPI/h -I../../dataflowAPI/h -DUSE_PARSE_API
74         LDFLAGS += -L../../parseAPI/$(PLATFORM) -lparseAPI      
75         SRCS += ../src/analysis_stepper.C \
76                 ../src/callchecker-IAPI.C
77 else
78         SRCS += ../src/callchecker.C
79 endif
80
81 ifndef WITHOUT_SYMTAB_API
82         MYFLAGS += -I../../symtabAPI/h -DWITH_SYMTAB_API -DWITHOUT_SYMLITE
83         LDFLAGS += -L../../symtabAPI/$(PLATFORM) -lsymtabAPI
84 else
85         MYFLAGS += -I../../symlite/h -DWITHOUT_SYMTAB_API -DWITH_SYMLITE
86         LDFLAGS += -L../../symlite/$(PLATFORM) -lsymLite
87 endif
88
89 LDFLAGS += -L../../proccontrol/$(PLATFORM) -lpcontrol
90
91 IFLAGS       += -I../$(PLATFORM) -I../src -I../h -I../../proccontrol/h -I../../symtabAPI/h -I../../parseAPI/h -I../../instructionAPI/h
92
93 ifdef WRAPPER_LIBS
94 all: libstackwalk_c.so
95 install: $(DEST)/libstackwalk_c.so
96 endif
97
98 SWOBJS = $(filter-out sw_c.o, $(OBJS))
99 SWOBJS += $(wildcard $(TO_CORE)/common/$(PLATFORM)/*.o)
100
101 comma:=,
102 empty:=
103 space:= $(empty) $(empty)
104 WRAPPER_LIBS_NOCOMMA = $(subst $(comma),$(space),$(WRAPPER_LIBS))
105
106 libsw.a: $(SWOBJS)
107         ar rs $@ $(SWOBJS)
108
109 libstackwalk_c.so: libsw.a sw_c.o
110         g++ -o $@ -shared sw_c.o -Wl,--exclude-libs -Wl,ALL libsw.a $(WRAPPER_LIBS_NOCOMMA)
111
112 $(DEST)/libstackwalk_c.so: libstackwalk_c.so
113         -$(INSTALL) libstackwalk_c.so $(DEST)