Makefile 4.1 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Copyright 1996 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for Debugger
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date       Name         Description
# ----       ----         -----------
22
# 10-May-01  KJB          Nicked
Neil Turton's avatar
Neil Turton committed
23 24
#

25 26 27 28 29
# Use COMPONENT=Debugger (or leave unset) to build the Debugger module
# Use COMPONENT=dis2 to build a full, standalone version of the C-based disassembler
COMPONENT    ?= Debugger

ifeq ("${COMPONENT}","Debugger")
30
HELPSRC       = HelpSrc
31
TOKENSOURCE   = s.TokHelpSrc
32
TOKHELPSRC    = ${TOKENSOURCE}
33
ASMHDRS       = Debugger
34
OBJS          = Debugger util dis2_vfp support exc
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
HDRS          =
CMHGFILE      =

# dis2 build options
ARM           = FALSE
THUMB         = FALSE
MODULE        = TRUE
endif

ifeq ("${COMPONENT}","dis2")
OBJS          = util dis2_arm main

# dis2 build options
ARM           = TRUE
THUMB         = FALSE
MODULE        = FALSE
endif


ifeq (${ARM},TRUE)
CDEFINES += -DDISASSEMBLE_ARM
endif

ifeq (${THUMB},TRUE)
CDEFINES += -DDISASSEMBLE_THUMB
endif

ifeq (${MODULE},TRUE)
CDEFINES += -DMODULE
RAMASMDEFINES += -PD "standalone SETL {TRUE}" -PD "MergedMsgs SETS \"${MERGEDMSGS}\""
endif

ifeq ("${COMPONENT}","Debugger")
include CModule

# We don't want to link to CLib
Robert Sprowson's avatar
Robert Sprowson committed
71 72 73
ROM_LIBS =
SA_LIBS  =
ROM_SYMS =
74 75 76 77 78 79 80 81 82 83

CFLAGS += -apcs /nofp
else
include CApp
endif

ACTIONS_ARM = actions/common \
              actions/ARMv7 \
              actions/ARMv7_ASIMD \
              actions/ARMv7_VFP \
84
              actions/ARMv8_AArch32 \
85
              actions/ARMv8FP_AArch32 \
86 87 88 89 90
              actions/FPA \
              actions/XScale_DSP

ACTIONS_VFP = actions/common \
              actions/ARMv7_ASIMD \
91 92
              actions/ARMv7_VFP \
              actions/ARMv8FP_AArch32
93 94

ENCODINGS = Build:decgen.encodings.ARMv7 \
95
            Build:decgen.encodings.ARMv8FP_AArch32 \
96
            Build:decgen.encodings.ARMv8_AArch32 \
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
            Build:decgen.encodings.FPA \
            Build:decgen.encodings.XScale_DSP

DECGEN = <Tools$Dir>.Misc.decgen.decgen 

# dis2 build rules

dis2_arm.c: $(ACTIONS_ARM) head.c $(ENCODINGS)
	$(DECGEN) -bits=32 -e "-DCDP={ne(coproc,1)}" "-DLDC_STC={ne(coproc,1)}{ne(coproc,2)}" "-DMRC_MCR={ne(coproc,1)}" -DVFP1=(cond:4) "-DVFP2={ne(cond,15)}" -DAS1(X)=1111001[X] -DAS2=11110100 -DAS3=(cond:4)1110 "-DAS4={ne(cond,15)}" "-DCC={ne(cond,15)}" $(ENCODINGS) -valid -a $(ACTIONS_ARM) -pre head.c -o dis2_arm.c -prefix=dis2_ -name=dis2 -void -maxmaskbits=3 -opt-strings -treewalker -useargstruct -updatecache cache/arm

dis2_arm.o: dis2_arm.c
	${CC} ${CFLAGS} -o $@ dis2_arm.c

dis2_arm.oz: dis2_arm.c
	${CC} ${CFLAGS} ${C_MODULE} -o $@ dis2_arm.c

dis2_vfp.c: $(ACTIONS_VFP) head.c $(ENCODINGS)
	$(DECGEN) -bits=32 -e "-DCDP={ne(coproc,1)}" "-DLDC_STC={ne(coproc,1)}{ne(coproc,2)}" "-DMRC_MCR={ne(coproc,1)}" -DVFP1=(cond:4) "-DVFP2={ne(cond,15)}" -DAS1(X)=1111001[X] -DAS2=11110100 -DAS3=(cond:4)1110 "-DAS4={ne(cond,15)}" "-DCC={ne(cond,15)}" $(ENCODINGS) -valid -a $(ACTIONS_VFP) -pre head.c -o dis2_vfp.c -prefix=dis2_ -name=dis2 -default=UNDEFINED -void -maxmaskbits=3 -opt-strings -treewalker -useargstruct -updatecache cache/vfp

dis2_vfp.o: dis2_vfp.c
	${CC} ${CFLAGS} -o $@ dis2_vfp.c

dis2_vfp.oz: dis2_vfp.c
	${CC} ${CFLAGS} ${C_MODULE} -o $@ dis2_vfp.c

122 123 124 125 126
excdump.h: hdr.ExcDump
	${HDR2H} hdr.ExcDump $@

exc.c: excdump.h

127 128 129
clean::
	${RM} c.dis2_vfp
	${RM} c.dis2_arm
130
	${RM} h.excdump
131 132 133 134 135 136 137 138
	${RM} ${TOKENSOURCE}

# Stuff from AAsmModule that's missing from CModule

TOKENS     ?= Hdr:Tokens

${TOKENSOURCE}: ${HELPSRC} ${TOKENS}
	${TOKENISE} ${TOKENS} ${HELPSRC} $@
David Cotton's avatar
David Cotton committed
139

140
Debugger.o: ${TOKENSOURCE}
141

Neil Turton's avatar
Neil Turton committed
142
# Dynamic dependencies: