Initial commit
[amiga/OpenBoopsi.git] / config.mk
1 ##
2 ## $Id: config.mk,v 1.1 2000/01/12 20:34:26 bernie Exp $
3 ##
4 ## Build environment configuration parameters
5 ## Copyright (C) 1999 by B. Innocenti & M. Cavalleri
6
7
8 ###########################################################
9 # Package configuration
10 ###########################################################
11
12 # CPU to compile for (eg: "68020").
13 #
14 CPU := 68020
15
16 # Compiler to use. Possible options are:
17 # sc     - SAS/C 6.58 or better
18 # gcc    - gcc 2.7.2 or EGCS 1.1b
19 # vbcc   - Not yet supported
20 # stormc - Not yet supported
21 #
22 COMPILER := gcc
23
24 # Additional include directories (e.g.: system headers)
25 #
26 C_INCLUDE_PATH := -I/gg/include -I/include
27
28 # compiling options: set this variable to
29 # 0 to link the demo programs with the standard
30 # startup libraries, se to other values to
31 # link to obj/app_startup.o
32 #
33 NOSTDLIB := 0
34
35
36 ###########################################################
37 # Tools used in the Makefiles
38 ###########################################################
39
40 NOP                     := echo
41 ECHO            := echo
42 FLUSHLIBS       := Avail FLUSH >NIL:
43 MAKEINFO        := GG:bin/makeinfo
44 FD2PRAGMA       := fd2pragma
45 HUNK2AOUT       := hunk2aout
46 FLEXCAT         := FlexCat
47 ARCHIVER        := LZX -3 -e -r a
48
49
50 ###########################################################
51 # Compiler, linker and assembler flags
52 ###########################################################
53
54 # Flags for SAS/C
55 #
56 ifeq ($(strip $(COMPILER)),sc)
57
58         APP_STARTUP_SRC := $(TOP)/common/startup_sc.s
59
60         CC      := sc
61         AS      := PhxAss
62         ASM     := $(AS)
63         LD      := PhxLnk
64         LDNOLIB := PhxLnk
65         CP      := copy CLONE
66         REN := rename
67         RM      := delete
68
69         # GST usage must sometimes be disabled due to bugs in SAS/C 6.58
70         GST     := $(OBJDIR)/$(PROJNAME).gst
71
72         # Note: Using the "STRCONST" compiler option requires
73         #       patched versions of the OS headers to work correctly
74
75         # compiler flags
76         #
77         OPT_CFLAGS := OPTIMIZE OPTTIME OPTSCHEDULER OPTINLINELOCAL \
78                                 OPTRDEPTH=4 OPTDEPTH=4 OPTCOMP=8 DATA=NEAR CODE=NEAR
79         DBG_CFLAGS := NOOPTIMIZE DEBUG=FULLFLUSH ONERROR=CONTINUE CODE=FAR \
80                                 DATA=FAR DEF DEBUG=1
81         CMN_CFLAGS := PARAMS=REGISTERS STRMERGE AFP UTILLIB INCDIR=$(INCDIR) \
82                                 NOSTKCHK NOCHKABORT NOICONS STRSECT=CODE GST $(GST) CPU=$(CPU)
83
84         # assembler flags
85         #
86         OPT_SFLAGS := SMALLDATA SMALLCODE ALIGN MACHINE=$(CPU) OPT !
87         DBG_SFLAGS := SYMDEBUG LINEDEBUG SET "_DEBUG=1"
88         CMN_SFLAGS := INCPATH=INCLUDE:,$(INCDIR) NOEXE QUIET
89
90         # linker flags
91         #
92         # Use the utility.library for 32bit multiplication and division.
93         #
94         # The C runtime library is never used but it's still needed because
95         # SAS/C sometimes generates code that referencess symbols such as
96         # _CXAMEMSET or _CXAMEMCPY
97         #
98         OPT_LFLAGS := NODEBUG
99         DBG_LFLAGS := NOSHORTRELOCS ADDSYM
100         CMN_LFLAGS := SMALLCODE SMALLDATA NOALVS NOICONS BATCH DEFINE \
101                                 "__CXM33=__UCXM33,__CXD33=__UCXD33,__CXM22=__UCXM22,__CXD22=__UCXD22"
102
103         OPT_LIBS   :=
104         DBG_LIBS   := LIB:debug.lib LIB:small.lib
105         CMN_LIBS   := LIB:sc.lib
106
107         # misc flags
108         #
109         TO  := TO
110         OBJ := NOLINK
111         DEF := DEFINE
112
113         # Additional flags for SAS/C GST support
114         #
115         ifneq ($(strip $(GST)),)
116                 CMN_CFLAGS += GST=$(GST)
117         endif
118 endif
119
120 #
121 # Flags for gcc or egcs
122 #
123 ifeq ($(strip $(COMPILER)),gcc)
124
125         APP_STARTUP_SRC := $(TOP)/common/startup_gcc.s
126
127         CC      := gcc -c
128         AS      := as
129         ASM     := PhxAss
130         LD      := gcc -noixemul
131         LDNOLIB := gcc -nostartfiles -noixemul
132         CP      := cp
133         MV  := mv
134         REN := $(MV)
135         RM      := rm
136
137         # compiler flags
138         #
139         # if you have some custom include directory we suggest you to
140         # use the variable C_INCLUDE_PATH instead of adding it to
141         # the directories list below via tha argument -I
142         #
143         OPT_CFLAGS := -O2 -msmall-code -fomit-frame-pointer -mregparm -funroll-loops \
144                                 -finline-functions -fno-implement-inlines
145         DBG_CFLAGS := -D_DEBUG=1 -g
146         CMN_CFLAGS := -m$(CPU) -Wundef -Wimplicit -Winline -Wreturn-type \
147                                 -I$(TOP)/include/ $(C_INCLUDE_PATH)
148
149         # assembler flags (for PhxAss, not as. these are needed
150         # to compile the library startup code).
151         #
152         OPT_SFLAGS := SMALLDATA SMALLCODE ALIGN MACHINE=$(CPU) OPT !
153         DBG_SFLAGS := SYMDEBUG LINEDEBUG SET "DEBUG"
154         CMN_SFLAGS := INCPATH=INCLUDE:,$(INCDIR) NOEXE QUIET
155
156         # linker flags
157         #
158         OPT_LFLAGS := -s
159         DBG_LFLAGS :=
160         CMN_LFLAGS :=
161
162         OPT_LIBS   :=
163         DBG_LIBS   := -lamiga_debug
164         CMN_LIBS   :=
165
166         # misc flags
167         #
168         TO  := -o
169         OBJ := -c
170         DEF := -D
171 endif
172
173
174
175 ###########################################################
176 ###########################################################
177 # You shouldn't need to modify anything below this line
178 ###########################################################
179 ###########################################################
180
181
182
183 # distribution version is compiled with these flags
184 #
185 O_CFLAGS := $(CMN_CFLAGS) $(OPT_CFLAGS)
186 O_SFLAGS := $(CMN_SFLAGS) $(OPT_SFLAGS)
187 O_LFLAGS := $(CMN_LFLAGS) $(OPT_LFLAGS)
188 O_LIBS   := $(CMN_LIBS) $(OPT_LIBS)
189
190
191 # debug version is compiled with these flags
192 #
193 D_CFLAGS := $(CMN_CFLAGS) $(DBG_CFLAGS)
194 D_SFLAGS := $(CMN_SFLAGS) $(DBG_SFLAGS)
195 D_LFLAGS := $(CMN_LFLAGS) $(DBG_LFLAGS)
196 D_LIBS   := $(CMN_LIBS) $(DBG_LIBS)
197
198
199 ###########################################################
200 # Paths
201 ###########################################################
202
203 OBJDIR          := $(TOP)/obj
204 INCDIR          := $(TOP)/include
205 PREFIX          := $(TOP)/dist
206
207 PROJNAME        := OpenBoopsi
208 ARCNAME         := $(PREFIX)/$(PROJNAME).lzx
209 SRCARCNAME      := $(PREFIX)/$(PROJNAME)_src.lzx
210
211 # APP_STARTUP_SRC is defined in the
212 # compiler specific sections
213 #
214 APP_STARTUP     := $(OBJDIR)/app_startup.o