Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: mak -*-
2
###############################################################################
3
# File:         PLATFORM/amx.def
4
# Contents:     AMX platform defines
5
#
6
# Revision History:
7
#   16/08/99    APY Created
8
#   16/11/01    APY Build env +v2.0 support, appended ';' to rules
9
#
10
# Note:
11
#   The following have to be defined in a platform specific manner
12
#   below and come from one of the platform configuration makefiles.
13
#
14
#       amx_target      The name that AMX knows the processor by.
15
#                       This actually names directory at the root
16
#                       of the amx directory tree .. nominally one
17
#                       of `amx68k' or `amx386'.
18
#
19
#       amx_filesystem  The optional name that AMX knows the 
20
#                       filesystem by. This actually names directory
21
#                       at the root of the amx/fs directory tree .. 
22
#                       nominally one of `afs68k' or `afs386'.
23
#
24
#       amx_toolset     The suffix AMX uses for the build tools
25
#                       nominally `TOOLWC' or `TOOLMR'.
26
#
27
#       amx_name        The prefix of the name of AMX's configuration
28
#                       and library files (normally the AMX part number)
29
#
30
#       amx_fsname      The prefix of the name of AMX/FS configuration
31
#                       and library files (normally the AMX part number)
32
#
33
#       amx_calling     The tail end of the AMX library name.
34
#                       Unfortunately even though the amx librarys
35
#                       live in different directorys for different
36
#                       targets they also have different names.
37
#
38
# From the above we define....
39
#
40
#       amx_dir         Root of the amx platform/compiler specific
41
#                       tree.
42
#
43
#       amx_cfgdir      Configuration
44
#
45
#       amx_incdir      Include directory
46
#
47
#       amx_objdir      Object directory
48
#
49
#       amx_libdir      Library directory
50
#
51
###############################################################################
52
 
53
.PHONY:		amx
54
amx:
6177 dpurdie 55
	@if [ -z "$(AMX)" ]; then echo 'AMX env var not set'; exit 2; fi
227 dpurdie 56
 
57
amx		= $(subst \\,/,$(strip $(AMX)))
58
amx_bin 	= $(amx)/$(strip $(amx_target))/cfg
59
amx_bin2	= $(amx)/$(strip $(amx_target))/cfgbldw
60
 
61
amx_dir		= $(amx)/$(strip $(amx_target))/$(strip $(amx_toolset))
62
amx_cfgdir	= $(amx_dir)/cfg
63
amx_objdir	= $(amx_dir)/obj
64
amx_libdir	= $(amx_dir)/lib
65
amx_incdir	= $(amx_dir)/def
66
 
67
ifdef amx_filesystem
68
amxfs_dir	= $(amx)/$(strip $(amx_filesystem))/$(strip $(amx_toolset))
69
amxfs_cfgdir	= $(amxfs_dir)/cfg
70
amxfs_objdir	= $(amxfs_dir)/obj
71
amxfs_libdir	= $(amxfs_dir)/lib
72
amxfs_incdir	= $(amxfs_dir)/def
73
endif
74
 
75
ifeq "$(findstring $(PATH),$(amx))" ""
76
PATH		:= $(PATH);$(amx_bin);$(amx_bin2)
77
endif
78
 
79
TS_MASM_AS	= 1
80
 
81
#
82
 
83
cc_defines	+= AMX_$(amx_name)
84
cc_includes	+= $(amx_incdir)
85
as_includes	+= $(amx_incdir)
86
ld_libpath	+= $(amx_libdir)
87
ifdef amx_filesystem
88
cc_defines	+= AMXFS_$(amx_fsname)
89
cc_includes	+= $(amxfs_incdir)    
90
as_includes	+= $(amxfs_incdir)
91
ld_libpath	+= $(amxfs_libdir)
92
endif
93
 
94
define amx_xxx
6177 dpurdie 95
	@$(echo) '[Building $@]'
227 dpurdie 96
	@$(cmdfile) -ko$@ '\
97
/* AMX Linker funny stuff,\n\
98
 *	Force linker ordering requirements of AMX/EP and AMX/ET\n\
99
 *	whilst allowing main (and the startup code) to be placed\n\
100
 *	within a the library "eosas".\n\
101
 */\n\
102
extern void main(void);\n\
103
void   (*__main__) = main;\n'
104
endef
105
 
106
ifdef amx_filesystem
107
define amx_scf
6177 dpurdie 108
	@$(echo) '[Building - Software Config Module $@ "$<"]'
227 dpurdie 109
	@$(amx_name)CG $< $(amx_cfgdir)/$(amx_name)CG.CT $@1 ;
110
	@$(amx_name)CG $< $(amxfs_cfgdir)/$(amx_fsname)CG.CT $@2 ;
111
	@cat $@1 $@2 > $@; rm $@1 $@2
112
endef
113
else
114
define amx_scf
6177 dpurdie 115
	@$(echo) '[Building - Software Config Module $@ "$<"]'
227 dpurdie 116
	@$(amx_name)CG $< $(amx_cfgdir)/$(amx_name)CG.CT  $@;
117
endef
118
endif
119
 
120
define amx_tcf
6177 dpurdie 121
	@$(echo) '[Building - Target Config Module $@ "$<"]'
227 dpurdie 122
	@$(amx_name)CG $< $(amx_cfgdir)/$(amx_name)HDW.CT $@;
123
endef
124
 
125
define amx_pcf
6177 dpurdie 126
	@$(echo) '[Building - PC Config Module $@ "$<"]'
227 dpurdie 127
	@$(amx_name)CG $< $(amx_cfgdir)/$(amx_name)PCG.CT $@;
128
endef
129
 
130
define amx_int
6177 dpurdie 131
	@$(echo) '[Building - ISP Module $@ "$<"]'
227 dpurdie 132
	@$(amx_name)CG $< $(amx_cfgdir)/$(amx_name)INT.CT $@;
133
endef
134
 
135
define amx_icf
6177 dpurdie 136
	@$(echo) '[Building - Insight config Module' $@ "$<"]'
227 dpurdie 137
endef
138
 
139
#