Changes to work towards compatability with IBM's version of dyninst.
[dyninst.git] / dyninstAPI / tests / rs6000-ibm-aix4.2 / Makefile
1 #
2 # $Id: Makefile,v 1.17 2001/08/29 23:25:30 hollings Exp $
3 #
4
5 # Define any symbols needed to invoke configuration changes in make.config
6 TO_CORE =       ../../..
7 NO_OPT_FLAG=true
8 NO_IMPLICIT_TEMPLATES = true
9
10 # Include standard make configuration stuff that applies to everything
11 # in the paradyn tree.
12
13 include $(TO_CORE)/make.config 
14
15 # Now make any necessary architecture specific changes to variables:
16
17 MODCC = g++
18 CXX   = g++
19
20 CXXFLAGS += -DUSES_DYNAMIC_INF_HEAP -g
21 CFLAGS += -DUSES_DYNAMIC_INF_HEAP -g
22
23 NATIVE_CC = xlc
24 NATIVE_CXX = xlC
25
26 GNU_CC = gcc
27 GNU_CXX = g++
28
29 # Include the module-specific Makefile, which defines everything about
30 # the module that is common across architectures.
31
32 include ../make.module.tmpl
33
34 # replace testN.mutatee_compiler with ../src/testN.mutatatee.c
35 MUTATEE_OBJ = $(TARGET2:_$(MUTATEE_CC)=.o)
36
37 ifeq (xl,$(findstring xl,$(MUTATEE_CC)))
38 c1 = $(shell lslpp -l 'vacpp.cmp.C' | grep COMMITTED | head -1)
39 c2 = $(shell lslpp -l 'xlC.C' | grep COMMITTED | head -1)
40 versionArray = $(word 2,$(c1))
41 versionArray += $(word 2,$(c2))
42 versionArray += unknown
43 COMPILERT = $(MUTATEE_CC) version $(firstword $(versionArray))
44 MUTATEE_CFLAGS = $(ARCH_DEF) -bkeepfile:$(MUTATEE_OBJ)
45 ifeq ($(MUTATEE_CC),$(NATIVE_CXX))
46 MUTATEE_CFLAGS += -+
47 endif
48 else
49 COMPILERT = $(shell $(MUTATEE_CC) -v 2>&1 | grep version | head -1)
50 MUTATEE_CFLAGS = $(MODCFLAGS) -Wl,-bgcbypass:3 
51 endif
52
53 EMPTY:=
54 BLANK:=$(EMPTY) $(EMPTY)
55 LPAREN:=(
56 RPAREN:=)
57 COMPILER1 = $(subst $(BLANK),_,$(COMPILERT))
58 COMPILER2 = $(subst $(LPAREN),_,$(COMPILER1))
59 COMPILER = $(subst $(RPAREN),_,$(COMPILER2))
60 MUTATEE_CFLAGS += -DCOMPILER='"$(COMPILER)"'
61 LDFLAGS += -lbsd
62
63 $(TARGET2): $(MUTATEE_SRC)
64         -$(MUTATEE_CC) -g $(MUTATEE_CFLAGS) -Wl,-bnoobjreorder \
65         $(MUTATEE_SRC) -o $(TARGET2)
66
67 # Include the "standard program template".  This defines all the
68 # common targets like "clean", "install", etc.
69
70 include $(TO_CORE)/make.program.tmpl
71
72 libtestA.o:
73         $(CC) -g -c ../src/libtestA.c
74 libtestB.o:
75         $(CC) -g -c ../src/libtestB.c
76 libtestA.so: libtestA.o
77         ld -bM:SRE -bnoentry -o libtestA.so libtestA.o -bexpall -berok
78 libtestB.so: libtestB.o
79         ld -bM:SRE -bnoentry -o libtestB.so libtestB.o -bexpall -berok
80