source: trunk/testcase/456/common.gmk@ 1330

Last change on this file since 1330 was 724, checked in by bird, 22 years ago

More testcases.

  • Property cvs2svn:cvs-rev set to 1.10
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
Line 
1# $Id: common.gmk 724 2003-09-24 18:49:08Z bird $
2#
3# common makefile stuff for the defect 456 (Stabs -> HLL)
4#
5# Assumes TARGET is set.
6#
7
8
9
10ifndef PATH_TARGET
11PATH_TARGET = bin
12endif
13ifndef TARGET_SRCEXT
14TARGET_SRCEXT = c
15endif
16ifndef TARGET2_SRCEXT
17TARGET2_SRCEXT = c
18endif
19ifndef TARGET_SOURCE
20TARGET_SOURCE = $(TARGET).$(TARGET_SRCEXT)
21endif
22ifndef TARGET2_SOURCE
23TARGET2_SOURCE = $(TARGET2).$(TARGET2_SRCEXT)
24endif
25
26ifndef EMXOMF
27EMXOMF = emxomf.exe
28else
29EMXOMF_DEP = $(EMXOMF)
30endif
31
32ifndef LISTOMF
33LISTOMF = listomf.exe
34else
35LISTOMF_DEP = $(LISTOMF)
36endif
37
38ifndef GCC
39GCC = gcc
40endif
41ifndef GXX
42GXX = g++
43endif
44
45
46ifndef NOLINKING
47TARGET_LINKED_VAC = $(PATH_TARGET)/$(TARGET).vac.exe \
48 $(PATH_TARGET)/$(TARGET).vac.dump \
49 $(PATH_TARGET)/$(TARGET).vac.hlldump
50TARGET_LINKED_GCC = $(PATH_TARGET)/$(TARGET).gcc.exe \
51 $(PATH_TARGET)/$(TARGET).gcc.dump \
52 $(PATH_TARGET)/$(TARGET).gcc.hlldump
53endif
54
55ifdef TARGET2
56TARGET2_VAC = $(PATH_TARGET)/$(TARGET2).vac.obj \
57 $(PATH_TARGET)/$(TARGET2).vac.lst
58TARGET2_GCC = $(PATH_TARGET)/$(TARGET2).gcc.s \
59 $(PATH_TARGET)/$(TARGET2).gcc.o \
60 $(PATH_TARGET)/$(TARGET2).gcc.obj \
61 $(PATH_TARGET)/$(TARGET2).gcc.lst
62
63TARGET2_LINK_VAC = $(PATH_TARGET)/$(TARGET2).vac.obj
64TARGET2_LINK_GCC = $(PATH_TARGET)/$(TARGET2).gcc.obj
65endif
66
67.SUFFIXES:
68.SUFFIXES:
69
70
71all: $(TARGET)
72
73
74$(TARGET): vac gcc
75
76
77vac: \
78 $(PATH_TARGET)/$(TARGET).vac.obj \
79 $(PATH_TARGET)/$(TARGET).vac.lst \
80 $(TARGET2_VAC) \
81 $(TARGET_LINKED_VAC)
82
83gcc: \
84 $(PATH_TARGET)/$(TARGET).gcc.s \
85 $(PATH_TARGET)/$(TARGET).gcc.o \
86 $(PATH_TARGET)/$(TARGET).gcc.obj \
87 $(PATH_TARGET)/$(TARGET).gcc.lst \
88 $(TARGET2_GCC) \
89 $(TARGET_LINKED_GCC)
90
91
92
93$(PATH_TARGET)/$(TARGET).vac.hlldump: $(PATH_TARGET)/$(TARGET).vac.exe
94 -hlldump $< > $@
95
96$(PATH_TARGET)/$(TARGET).gcc.hlldump: $(PATH_TARGET)/$(TARGET).gcc.exe
97 -hlldump $< > $@
98
99
100
101$(PATH_TARGET)/$(TARGET).vac.dump: $(PATH_TARGET)/$(TARGET).vac.exe
102 rdrdump $< > $@
103
104$(PATH_TARGET)/$(TARGET).gcc.dump: $(PATH_TARGET)/$(TARGET).gcc.exe
105 rdrdump $< > $@
106
107
108
109$(PATH_TARGET)/$(TARGET).vac.exe: $(PATH_TARGET)/$(TARGET).vac.obj $(TARGET2_LINK_VAC)
110 icc -Ti+ /Fm$(PATH_TARGET)/$(TARGET).vac.map /B/LINENUMBERS /B/DBGPACK -Fe$@ $< $(TARGET2_LINK_VAC)
111
112$(PATH_TARGET)/$(TARGET).gcc.exe: $(PATH_TARGET)/$(TARGET).gcc.obj $(TARGET2_LINK_GCC)
113ifeq "$(TARGET_SRCEXT)" ".c"
114 if $(GCC) -g -Zomf -Zcrtdll -Zmap=$(PATH_TARGET)/$(TARGET).gcc.map -o $@ -Zlinker "/LINENUMBERS /MAP:FULL /PM:VIO" $< $(TARGET2_LINK_GCC); then true; else rm -f $@; false; fi
115else
116 if $(GXX) -g -Zomf -Zcrtdll -Zmap=$(PATH_TARGET)/$(TARGET).gcc.map -o $@ -Zlinker "/LINENUMBERS /MAP:FULL /PM:VIO" $< $(TARGET2_LINK_GCC); then true; else rm -f $@; false; fi
117endif
118
119
120$(PATH_TARGET)/$(TARGET).vac.obj: $(TARGET_SOURCE)
121 icc -c -Gd -Ti+ -Fo$@ $<
122$(PATH_TARGET)/$(TARGET2).vac.obj: $(TARGET2_SOURCE)
123 icc -c -Gd -Ti+ -Fo$@ $<
124
125
126$(PATH_TARGET)/$(TARGET).gcc.obj: $(PATH_TARGET)/$(TARGET).gcc.o $(EMXOMF_DEP)
127 $(EMXOMF) -o $@ $< > $@.emxomf 2>&1
128 cat $@.emxomf
129$(PATH_TARGET)/$(TARGET2).gcc.obj: $(PATH_TARGET)/$(TARGET2).gcc.o $(EMXOMF_DEP)
130 $(EMXOMF) -o $@ $< > $@.emxomf 2>&1
131 cat $@.emxomf
132
133$(PATH_TARGET)/$(TARGET).gcc.o: $(TARGET_SOURCE)
134 $(GCC) -c -g -o $@ $<
135$(PATH_TARGET)/$(TARGET2).gcc.o: $(TARGET2_SOURCE)
136 $(GCC) -c -g -o $@ $<
137
138$(PATH_TARGET)/$(TARGET).gcc.s: $(TARGET_SOURCE)
139 $(GCC) -S -g -o $@ $<
140$(PATH_TARGET)/$(TARGET2).gcc.s: $(TARGET2_SOURCE)
141 $(GCC) -S -g -o $@ $<
142
143
144
145$(PATH_TARGET)/$(TARGET).vac.lst: $(PATH_TARGET)/$(TARGET).vac.obj $(LISTOMF_DEP)
146 -$(LISTOMF) -x $< > $@
147$(PATH_TARGET)/$(TARGET2).vac.lst: $(PATH_TARGET)/$(TARGET2).vac.obj $(LISTOMF_DEP)
148 -$(LISTOMF) -x $< > $@
149
150$(PATH_TARGET)/$(TARGET).gcc.lst: $(PATH_TARGET)/$(TARGET).gcc.obj $(LISTOMF_DEP)
151 -$(LISTOMF) -x $< > $@
152$(PATH_TARGET)/$(TARGET2).gcc.lst: $(PATH_TARGET)/$(TARGET2).gcc.obj $(LISTOMF_DEP)
153 -$(LISTOMF) -x $< > $@
154
155
156clean:
157 rm -f \
158 $(PATH_TARGET)/$(TARGET).vac.obj \
159 $(PATH_TARGET)/$(TARGET).vac.lst \
160 $(PATH_TARGET)/$(TARGET).vac.exe \
161 $(PATH_TARGET)/$(TARGET).vac.map \
162 $(PATH_TARGET)/$(TARGET).vac.dump \
163 $(PATH_TARGET)/$(TARGET).vac.hlldump \
164 $(PATH_TARGET)/$(TARGET).gcc.o \
165 $(PATH_TARGET)/$(TARGET).gcc.s \
166 $(PATH_TARGET)/$(TARGET).gcc.obj \
167 $(PATH_TARGET)/$(TARGET).gcc.lst \
168 $(PATH_TARGET)/$(TARGET).gcc.exe \
169 $(PATH_TARGET)/$(TARGET).gcc.map \
170 $(PATH_TARGET)/$(TARGET).gcc.dump \
171 $(PATH_TARGET)/$(TARGET).gcc.hlldump
172ifdef TARGET2_VAC
173 rm -f \
174 $(PATH_TARGET)/$(TARGET2).gcc.o \
175 $(PATH_TARGET)/$(TARGET2).gcc.s \
176 $(PATH_TARGET)/$(TARGET2).gcc.obj \
177 $(PATH_TARGET)/$(TARGET2).gcc.lst \
178 $(PATH_TARGET)/$(TARGET2).vac.obj \
179 $(PATH_TARGET)/$(TARGET2).vac.lst
180endif
181
182
Note: See TracBrowser for help on using the repository browser.