blob: 723c850d47250c253f59e107ef6fb96b5d3250d4 [file] [log] [blame]
sewardjc5bfaee2004-07-22 17:25:03 +00001
2PUB_HEADERS = pub/libvex_basictypes.h \
3 pub/libvex_ir.h \
sewardj37a47aa2005-01-21 20:54:33 +00004 pub/libvex.h \
5 pub/libvex_trc_values.h \
6 pub/libvex_emwarn.h \
7 pub/libvex_guest_x86.h \
8 pub/libvex_guest_amd64.h \
sewardj42065842005-01-27 16:04:08 +00009 pub/libvex_guest_arm.h \
sewardj600deec2005-03-21 01:03:49 +000010 pub/libvex_guest_ppc32.h \
ceriond0eae2d2005-12-23 11:43:01 +000011 pub/libvex_guest_ppc64.h \
sewardj600deec2005-03-21 01:03:49 +000012 pub/libvex_guest_offsets.h
sewardjc5bfaee2004-07-22 17:25:03 +000013
sewardjd7383ba2004-07-27 10:54:21 +000014PRIV_HEADERS = priv/host-x86/hdefs.h \
sewardjb7a0a112005-02-01 16:06:14 +000015 priv/host-amd64/hdefs.h \
sewardj37a47aa2005-01-21 20:54:33 +000016 priv/host-arm/hdefs.h \
ceriond0eae2d2005-12-23 11:43:01 +000017 priv/host-ppc/hdefs.h \
sewardjd7383ba2004-07-27 10:54:21 +000018 priv/host-generic/h_generic_regs.h \
sewardj37a47aa2005-01-21 20:54:33 +000019 priv/host-generic/h_generic_simd64.h \
sewardjc5bfaee2004-07-22 17:25:03 +000020 priv/main/vex_globals.h \
21 priv/main/vex_util.h \
sewardj52ff4cc2005-03-26 20:33:38 +000022 priv/guest-generic/g_generic_x87.h \
sewardjdb36c0f2005-07-03 00:05:31 +000023 priv/guest-generic/bb_to_IR.h \
sewardj37a47aa2005-01-21 20:54:33 +000024 priv/guest-x86/gdefs.h \
25 priv/guest-amd64/gdefs.h \
26 priv/guest-arm/gdefs.h \
ceriond0eae2d2005-12-23 11:43:01 +000027 priv/guest-ppc/gdefs.h \
sewardj37a47aa2005-01-21 20:54:33 +000028 priv/ir/irmatch.h \
29 priv/ir/iropt.h
sewardjc5bfaee2004-07-22 17:25:03 +000030
sewardjd7383ba2004-07-27 10:54:21 +000031LIB_OBJS = priv/ir/irdefs.o \
sewardj37a47aa2005-01-21 20:54:33 +000032 priv/ir/irmatch.o \
33 priv/ir/iropt.o \
sewardjc5bfaee2004-07-22 17:25:03 +000034 priv/main/vex_main.o \
35 priv/main/vex_globals.o \
36 priv/main/vex_util.o \
sewardjd7383ba2004-07-27 10:54:21 +000037 priv/host-x86/hdefs.o \
sewardjb7a0a112005-02-01 16:06:14 +000038 priv/host-amd64/hdefs.o \
sewardj37a47aa2005-01-21 20:54:33 +000039 priv/host-arm/hdefs.o \
ceriond0eae2d2005-12-23 11:43:01 +000040 priv/host-ppc/hdefs.o \
sewardjd7383ba2004-07-27 10:54:21 +000041 priv/host-x86/isel.o \
sewardjb7a0a112005-02-01 16:06:14 +000042 priv/host-amd64/isel.o \
sewardj37a47aa2005-01-21 20:54:33 +000043 priv/host-arm/isel.o \
ceriond0eae2d2005-12-23 11:43:01 +000044 priv/host-ppc/isel.o \
sewardjd7383ba2004-07-27 10:54:21 +000045 priv/host-generic/h_generic_regs.o \
sewardj37a47aa2005-01-21 20:54:33 +000046 priv/host-generic/h_generic_simd64.o \
47 priv/host-generic/reg_alloc2.o \
sewardj52ff4cc2005-03-26 20:33:38 +000048 priv/guest-generic/g_generic_x87.o \
sewardjdb36c0f2005-07-03 00:05:31 +000049 priv/guest-generic/bb_to_IR.o \
sewardjd7383ba2004-07-27 10:54:21 +000050 priv/guest-x86/ghelpers.o \
sewardj37a47aa2005-01-21 20:54:33 +000051 priv/guest-amd64/ghelpers.o \
52 priv/guest-arm/ghelpers.o \
ceriond0eae2d2005-12-23 11:43:01 +000053 priv/guest-ppc/ghelpers.o \
sewardj37a47aa2005-01-21 20:54:33 +000054 priv/guest-x86/toIR.o \
55 priv/guest-amd64/toIR.o \
sewardj42065842005-01-27 16:04:08 +000056 priv/guest-arm/toIR.o \
ceriond0eae2d2005-12-23 11:43:01 +000057 priv/guest-ppc/toIR.o
sewardjc5bfaee2004-07-22 17:25:03 +000058
59PUB_INCLUDES = -Ipub
60
sewardjd7383ba2004-07-27 10:54:21 +000061# Do not add any priv/host-ARCH or priv/guest-ARCH directories to this
62# list, as they contain duplicate file names (each host has a hdefs.h,
63# for example).
64PRIV_INCLUDES = -Ipriv
sewardjc5bfaee2004-07-22 17:25:03 +000065
66
sewardj37a47aa2005-01-21 20:54:33 +000067#CC = gcc
sewardj42065842005-01-27 16:04:08 +000068#CCFLAGS = -g -O -Wall -Wmissing-prototypes -Wshadow -Winline \
69# -Wpointer-arith -Wbad-function-cast -Wcast-qual \
sewardj600deec2005-03-21 01:03:49 +000070# -Wcast-align -Wmissing-declarations \
sewardj42065842005-01-27 16:04:08 +000071# $(EXTRA_CFLAGS)
sewardjc5bfaee2004-07-22 17:25:03 +000072
73CC = icc
sewardj62d05432005-10-29 22:30:47 +000074CCFLAGS = -g -Wall -wd981 -wd279 -wd1287 -wd869 -wd111 -wd188 -wd186 -wd810
sewardjc5bfaee2004-07-22 17:25:03 +000075# 981: operands are evaluated in unspecified order
76# 279: controlling expression is constant
77# 1287: invalid attribute for parameter
78# 869: parameter "..." was never referenced
sewardjc5bfaee2004-07-22 17:25:03 +000079# 111: statement is unreachable
sewardj43e336c2005-01-28 01:53:38 +000080# 188: enumerated type mixed with another type
sewardjc5bfaee2004-07-22 17:25:03 +000081# (the above are for icc 8.0 -- 8.0.0.55 I think)
sewardj52ff4cc2005-03-26 20:33:38 +000082# 186: pointless comparison of unsigned integer with zero
sewardj62d05432005-10-29 22:30:47 +000083# 810: conversion from ... to ... may lose significant bits
sewardjb7a0a112005-02-01 16:06:14 +000084
sewardj37a47aa2005-01-21 20:54:33 +000085all: vex
sewardjd7383ba2004-07-27 10:54:21 +000086
cerione1106f72005-02-16 09:09:46 +000087scratch: clean version all
88
sewardjd7383ba2004-07-27 10:54:21 +000089vex: libvex.a test_main.o
90 $(CC) $(CCFLAGS) -o vex test_main.o libvex.a
sewardjc5bfaee2004-07-22 17:25:03 +000091
92libvex.a: $(LIB_OBJS)
93 rm -f libvex.a
94 ar clq libvex.a $(LIB_OBJS)
95
96clean:
sewardj600deec2005-03-21 01:03:49 +000097 rm -f $(LIB_OBJS) libvex.a vex test_main.o \
98 priv/main/vex_svnversion.h \
99 pub/libvex_guest_offsets.h
sewardjc5bfaee2004-07-22 17:25:03 +0000100
sewardj37a47aa2005-01-21 20:54:33 +0000101version:
102 rm -f priv/main/vex_svnversion.h
103 echo -n "\"" > priv/main/vex_svnversion.h
104 svnversion -n . >> priv/main/vex_svnversion.h
105 echo "\"" >> priv/main/vex_svnversion.h
106
107minidist: version
108 rm -f vex--minidist-2005MMDD.tar
109 tar cf vex--minidist-2005MMDD.tar $(PUB_HEADERS) $(PRIV_HEADERS) \
110 priv/main/vex_svnversion.h \
111 test_main.c test_main.h \
112 Makefile \
113 `echo $(LIB_OBJS) | sed "s/\.o/\.c/g"`
114 @echo
115 @echo minidist done, size and svnversion follow:
116 @ls -l vex--minidist-2005MMDD.tar
117 @cat priv/main/vex_svnversion.h
118 @echo
sewardjc5bfaee2004-07-22 17:25:03 +0000119
sewardj600deec2005-03-21 01:03:49 +0000120pub/libvex_guest_offsets.h:
121 gcc -Wall -g -o auxprogs/genoffsets auxprogs/genoffsets.c
122 ./auxprogs/genoffsets > pub/libvex_guest_offsets.h
123
sewardjc5bfaee2004-07-22 17:25:03 +0000124
125ALL_HEADERS = $(PUB_HEADERS) $(PRIV_HEADERS)
126ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES)
127
sewardj37a47aa2005-01-21 20:54:33 +0000128test_main.o: $(PUB_HEADERS) test_main.c test_main.h
sewardjc5bfaee2004-07-22 17:25:03 +0000129 $(CC) $(CCFLAGS) $(PUB_INCLUDES) -o test_main.o \
130 -c test_main.c
131
sewardjd7383ba2004-07-27 10:54:21 +0000132priv/ir/irdefs.o: $(ALL_HEADERS) priv/ir/irdefs.c
133 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir/irdefs.o \
134 -c priv/ir/irdefs.c
sewardjc5bfaee2004-07-22 17:25:03 +0000135
sewardj37a47aa2005-01-21 20:54:33 +0000136priv/ir/irmatch.o: $(ALL_HEADERS) priv/ir/irmatch.c
137 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir/irmatch.o \
138 -c priv/ir/irmatch.c
139
140priv/ir/iropt.o: $(ALL_HEADERS) priv/ir/iropt.c
141 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir/iropt.o \
142 -c priv/ir/iropt.c
143
144priv/main/vex_main.o: $(ALL_HEADERS) priv/main/vex_main.c \
145 priv/main/vex_svnversion.h
sewardjc5bfaee2004-07-22 17:25:03 +0000146 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main/vex_main.o \
147 -c priv/main/vex_main.c
148
149priv/main/vex_globals.o: $(ALL_HEADERS) priv/main/vex_globals.c
150 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main/vex_globals.o \
151 -c priv/main/vex_globals.c
152
153priv/main/vex_util.o: $(ALL_HEADERS) priv/main/vex_util.c
154 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main/vex_util.o \
155 -c priv/main/vex_util.c
156
sewardjd7383ba2004-07-27 10:54:21 +0000157priv/host-x86/hdefs.o: $(ALL_HEADERS) priv/host-x86/hdefs.c
158 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-x86/hdefs.o \
159 -c priv/host-x86/hdefs.c
sewardjc5bfaee2004-07-22 17:25:03 +0000160
sewardjb7a0a112005-02-01 16:06:14 +0000161priv/host-amd64/hdefs.o: $(ALL_HEADERS) priv/host-amd64/hdefs.c
162 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-amd64/hdefs.o \
163 -c priv/host-amd64/hdefs.c
164
sewardj37a47aa2005-01-21 20:54:33 +0000165priv/host-arm/hdefs.o: $(ALL_HEADERS) priv/host-arm/hdefs.c
166 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-arm/hdefs.o \
167 -c priv/host-arm/hdefs.c
168
ceriond0eae2d2005-12-23 11:43:01 +0000169priv/host-ppc/hdefs.o: $(ALL_HEADERS) priv/host-ppc/hdefs.c
170 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-ppc/hdefs.o \
171 -c priv/host-ppc/hdefs.c
cerionbcf8c3e2005-02-04 16:17:07 +0000172
sewardjd7383ba2004-07-27 10:54:21 +0000173priv/host-x86/isel.o: $(ALL_HEADERS) priv/host-x86/isel.c
174 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-x86/isel.o \
175 -c priv/host-x86/isel.c
sewardjc5bfaee2004-07-22 17:25:03 +0000176
sewardjb7a0a112005-02-01 16:06:14 +0000177priv/host-amd64/isel.o: $(ALL_HEADERS) priv/host-amd64/isel.c
178 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-amd64/isel.o \
179 -c priv/host-amd64/isel.c
180
sewardj37a47aa2005-01-21 20:54:33 +0000181priv/host-arm/isel.o: $(ALL_HEADERS) priv/host-arm/isel.c
182 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-arm/isel.o \
183 -c priv/host-arm/isel.c
184
ceriond0eae2d2005-12-23 11:43:01 +0000185priv/host-ppc/isel.o: $(ALL_HEADERS) priv/host-ppc/isel.c
186 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-ppc/isel.o \
187 -c priv/host-ppc/isel.c
cerionbcf8c3e2005-02-04 16:17:07 +0000188
sewardjd7383ba2004-07-27 10:54:21 +0000189priv/host-generic/h_generic_regs.o: $(ALL_HEADERS) priv/host-generic/h_generic_regs.c
190 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-generic/h_generic_regs.o \
191 -c priv/host-generic/h_generic_regs.c
sewardjc5bfaee2004-07-22 17:25:03 +0000192
sewardj37a47aa2005-01-21 20:54:33 +0000193priv/host-generic/h_generic_simd64.o: $(ALL_HEADERS) priv/host-generic/h_generic_simd64.c
194 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-generic/h_generic_simd64.o \
195 -c priv/host-generic/h_generic_simd64.c
196
197priv/host-generic/reg_alloc2.o: $(ALL_HEADERS) priv/host-generic/reg_alloc2.c
198 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host-generic/reg_alloc2.o \
199 -c priv/host-generic/reg_alloc2.c
sewardjc5bfaee2004-07-22 17:25:03 +0000200
sewardjd7383ba2004-07-27 10:54:21 +0000201priv/guest-x86/toIR.o: $(ALL_HEADERS) priv/guest-x86/toIR.c
202 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-x86/toIR.o \
203 -c priv/guest-x86/toIR.c
sewardj36ca5132004-07-24 13:12:23 +0000204
sewardj52ff4cc2005-03-26 20:33:38 +0000205priv/guest-generic/g_generic_x87.o: $(ALL_HEADERS) priv/guest-generic/g_generic_x87.c
206 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-generic/g_generic_x87.o \
207 -c priv/guest-generic/g_generic_x87.c
208
sewardjdb36c0f2005-07-03 00:05:31 +0000209priv/guest-generic/bb_to_IR.o: $(ALL_HEADERS) priv/guest-generic/bb_to_IR.c
210 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-generic/bb_to_IR.o \
211 -c priv/guest-generic/bb_to_IR.c
212
sewardjd7383ba2004-07-27 10:54:21 +0000213priv/guest-x86/ghelpers.o: $(ALL_HEADERS) priv/guest-x86/ghelpers.c
214 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-x86/ghelpers.o \
215 -c priv/guest-x86/ghelpers.c
sewardj37a47aa2005-01-21 20:54:33 +0000216
217priv/guest-amd64/ghelpers.o: $(ALL_HEADERS) priv/guest-amd64/ghelpers.c
218 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-amd64/ghelpers.o \
219 -c priv/guest-amd64/ghelpers.c
220
221priv/guest-amd64/toIR.o: $(ALL_HEADERS) priv/guest-amd64/toIR.c
222 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-amd64/toIR.o \
223 -c priv/guest-amd64/toIR.c
224
225priv/guest-arm/ghelpers.o: $(ALL_HEADERS) priv/guest-arm/ghelpers.c
226 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-arm/ghelpers.o \
227 -c priv/guest-arm/ghelpers.c
228
229priv/guest-arm/toIR.o: $(ALL_HEADERS) priv/guest-arm/toIR.c
230 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-arm/toIR.o \
231 -c priv/guest-arm/toIR.c
sewardj42065842005-01-27 16:04:08 +0000232
ceriond0eae2d2005-12-23 11:43:01 +0000233priv/guest-ppc/ghelpers.o: $(ALL_HEADERS) priv/guest-ppc/ghelpers.c
234 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-ppc/ghelpers.o \
235 -c priv/guest-ppc/ghelpers.c
sewardj42065842005-01-27 16:04:08 +0000236
ceriond0eae2d2005-12-23 11:43:01 +0000237priv/guest-ppc/toIR.o: $(ALL_HEADERS) priv/guest-ppc/toIR.c
238 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-ppc/toIR.o \
239 -c priv/guest-ppc/toIR.c