Use install-sh to install dyninst libraries and includes rather than cp
[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   = 2
11 RELEASE_MINOR = 0
12
13 CFLAGS               += $(USEFULWARNINGS) $(DEFINES)
14 CXXFLAGS             += $(USEFULWARNINGS) $(DEFINES)
15
16 LDFLAGS += -L../../common/$(PLATFORM)
17
18 ifndef TARGET
19 ifdef STATIC_COMPS
20 STATIC_LIBRARY = true
21 TARGET = libstackwalk.a
22 else
23 TARGET = libstackwalk.so
24 MYFLAGS += -fPIC
25 endif
26 endif
27
28 LDFLAGS += -L$(TO_CORE)/common/$(PLATFORM) -L$(LIBRARY_DEST)
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 IFLAGS       += -I../$(PLATFORM) -I../src -I../h -I../../proccontrol/h
65
66 # All that, and we finally get a target...
67 all: $(TARGET) $(EXTRA_LIBS)
68
69 ifdef WRAPPER_LIBS
70 all: libstackwalk_c.so
71 install: $(DEST)/libstackwalk_c.so
72 endif
73
74 SWOBJS = $(filter-out sw_c.o, $(OBJS))
75 SWOBJS += $(wildcard $(TO_CORE)/common/$(PLATFORM)/*.o)
76
77 comma:=,
78 empty:=
79 space:= $(empty) $(empty)
80 WRAPPER_LIBS_NOCOMMA = $(subst $(comma),$(space),$(WRAPPER_LIBS))
81
82 libsw.a: $(SWOBJS)
83         ar rs $@ $(SWOBJS)
84
85 libstackwalk_c.so: libsw.a sw_c.o
86         g++ -o $@ -shared sw_c.o -Wl,--exclude-libs -Wl,ALL libsw.a $(WRAPPER_LIBS_NOCOMMA)
87
88 $(DEST)/libstackwalk_c.so: libstackwalk_c.so
89         -$(INSTALL) libstackwalk_c.so $(DEST)