1 #/***************************************************************************
3 # TheBar.mcc - Next Generation Toolbar MUI Custom Class
4 # Copyright (C) 2003-2005 Alfonso Ranieri
5 # Copyright (C) 2005-2007 by TheBar.mcc Open Source Team
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # TheBar class Support Site: http://www.sf.net/projects/thebar
19 # $Id: Makefile.os4 22 2007-01-02 21:30:56Z damato $
21 #***************************************************************************/
23 ###########################################################################
24 # This makefile is a very generic one. It tries to identify both, the host
25 # and the target operating system for which TheBar should be compiled.
26 # However, this auto-detection can be easily overridden by directly
27 # specifying an option on the commandline while calling 'make'.
31 # # to explicitly compile for AmigaOS3
34 # # to compile for AmigaOS4 but with debugging
35 # > make OS=os4 DEBUG=
38 #############################################
39 # find out the HOST operating system
40 # on which this makefile is run
43 ifeq ($(HOST
), AmigaOS
)
44 ifeq ($(shell uname
-m
), powerpc
)
47 ifeq ($(shell uname
-m
), ppc
)
53 #############################################
54 # now we find out the target OS for
55 # which we are going to compile TheBar in case
56 # the caller didn't yet define OS himself
58 ifeq ($(HOST
), AmigaOS4
)
61 ifeq ($(HOST
), AmigaOS
)
64 ifeq ($(HOST
), MorphOS
)
77 #############################################
78 # define common commands we use in this
79 # makefile. Please note that each of them
80 # might be overridden on the commandline.
93 # override commands for native builds
94 ifeq ($(HOST
), AmigaOS4
)
97 RMDIR
= delete
force all
101 ifeq ($(HOST
), AmigaOS
)
104 RMDIR
= delete
force all
107 ifeq ($(HOST
), MorphOS
)
110 RMDIR
= delete
force all
116 ###########################################################################
117 # CPU and DEBUG can be defined outside, defaults to above
118 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug
121 # OPTFLAGS are disabled by DEBUG normally!
123 # ignored warnings are:
124 # none - because we want to compile with -Wall all the time
131 MCCTARGET
= $(BINDIR
)/TheBar.mcc
132 MCCVTARGET
= $(BINDIR
)/TheBarVirt.mcc
133 TESTTARGET
= $(BINDIR
)/TheBar-Test
135 # Common compiler/linker flags
136 WARN
= -W
-Wall
-Wwrite-strings
137 OPTFLAGS
= -O3
-fomit-frame-pointer
-funroll-loops
140 CFLAGS
= -I.
-I..
/mcp
-I..
/include $(CPU
) $(WARN
) $(OPTFLAGS
) \
141 $(DEBUG
) $(DEBUGSYM
) -c
142 LDFLAGS
= $(CPU
) $(DEBUGSYM
) -nostartfiles
145 # different options per target OS
148 ##############################
151 # Compiler/link/strip commands
153 STRIP
= ppc-amigaos-strip
154 OBJDUMP
= ppc-amigaos-objdump
156 # Compiler/Linker flags
159 CFLAGS
+= -mcrt
=$(CRT
) -D__USE_INLINE__
-D__NEW_TIMEVAL_DEFINITION_USED__ \
160 -DNO_PPCINLINE_STDARG
-Wa
,-mregnames
161 LDFLAGS
+= -mcrt
=$(CRT
)
163 # additional object files required
164 M68KSTUBS
= $(OBJDIR
)/mccclass_68k.o
169 ##############################
172 # Compiler/link/strip commands
173 CC
= m68k-amigaos-gcc
174 STRIP
= m68k-amigaos-strip
175 OBJDUMP
= m68k-amigaos-objdump
177 # Compiler/Linker flags
178 CPU
= -m68020-60
-msoft-float
179 CFLAGS
+= -noixemul
-DNO_INLINE_STDARG
181 LDLIBS
+= -ldebug
-lmui
186 ##############################
189 # Compiler/link/strip commands
191 STRIP
= ppc-morphos-strip
192 OBJDUMP
= ppc-morphos-objdump
194 # Compiler/Linker flags
196 CFLAGS
+= -noixemul
-DNO_PPCINLINE_STDARG
203 ##############################
206 # Compiler/link/strip commands
208 STRIP
= i686-aros-strip
209 OBJDUMP
= i686-aros-objdump
211 # Compiler/Linker flags
219 ###########################################################################
220 # Here starts all stuff that is common for all target platforms and
223 MCCOBJS
= $(OBJDIR
)/mcc
/library.o \
224 $(OBJDIR
)/mcc
/brc1.o \
225 $(OBJDIR
)/mcc
/build.o \
226 $(OBJDIR
)/mcc
/class.o \
227 $(OBJDIR
)/mcc
/dragbar.o \
228 $(OBJDIR
)/mcc
/scale.o \
229 $(OBJDIR
)/mcc
/spacer.o \
230 $(OBJDIR
)/mcc
/utils.o \
233 MCCVOBJS
= $(OBJDIR
)/mccv
/library.o \
234 $(OBJDIR
)/mccv
/brc1.o \
235 $(OBJDIR
)/mccv
/build.o \
236 $(OBJDIR
)/mccv
/class.o \
237 $(OBJDIR
)/mccv
/dragbar.o \
238 $(OBJDIR
)/mccv
/scale.o \
239 $(OBJDIR
)/mccv
/spacer.o \
240 $(OBJDIR
)/mccv
/utils.o \
243 TESTOBJS
= $(OBJDIR
)/TheBar-Test.o \
244 $(OBJDIR
)/mcc
/brc1.o \
245 $(OBJDIR
)/mcc
/build.o \
246 $(OBJDIR
)/mcc
/class.o \
247 $(OBJDIR
)/mcc
/dragbar.o \
248 $(OBJDIR
)/mcc
/scale.o \
249 $(OBJDIR
)/mcc
/spacer.o \
250 $(OBJDIR
)/mcc
/utils.o \
255 all: $(BINDIR
) $(OBJDIR
) $(MCCTARGET
) $(MCCVTARGET
) $(TESTTARGET
)
257 # make the object directories
259 @printf
'\033[33mGenerating $@ directory\033[0m\n'
261 @
$(MKDIR
) $(OBJDIR
)/mcc
262 @
$(MKDIR
) $(OBJDIR
)/mccv
265 # make the binary directories
267 @printf
'\033[33mGenerating $@ directory\033[0m\n'
273 @printf
'\033[32mCompiling $<\033[0m\n'
274 @
$(CC
) $(CFLAGS
) $< -o
$@
276 $(OBJDIR
)/mcc
/%.o
: %.c
277 @printf
'\033[32mCompiling $<\033[0m\n'
278 @
$(CC
) $(CFLAGS
) $< -o
$@
280 $(OBJDIR
)/mccv
/%.o
: %.c
281 @printf
'\033[32mCompiling $<\033[0m\n'
282 @
$(CC
) $(CFLAGS
) -DVIRTUAL
$< -o
$@
284 $(OBJDIR
)/mccclass_68k.o
: ..
/include/mccclass_68k.c
285 @printf
'\033[32mCompiling $<\033[0m\n'
286 @
$(CC
) $(CFLAGS
) $< -o
$@
290 $(MCCTARGET
): $(M68KSTUBS
) $(MCCOBJS
)
291 @printf
'\033[32mLinking \033[1m$@\033[0m\n'
292 @
$(CC
) $(LDFLAGS
) -o
$@.debug
$(MCCOBJS
) $(M68KSTUBS
) $(LDLIBS
) -Wl
,-Map
,$@.map
293 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
295 $(MCCVTARGET
): $(M68KSTUBS
) $(MCCVOBJS
)
296 @printf
'\033[32mLinking \033[1m$@\033[0m\n'
297 @
$(CC
) $(LDFLAGS
) -o
$@.debug
$(MCCVOBJS
) $(M68KSTUBS
) $(LDLIBS
) -Wl
,-Map
,$@.map
298 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
300 $(TESTTARGET
): $(TESTOBJS
)
301 @printf
'\033[32mLinking \033[1m$@\033[0m\n'
302 @
$(CC
) -noixemul
-o
$@.debug
$(TESTOBJS
) $(LDLIBS
) -Wl
,-Map
,$@.map
303 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
305 ## DEPENDENCY GENERATION ##############
308 @printf
"\033[33mWARNING: Makefile.depend missing. Please run 'make depend'\033[0m\n"
312 @printf
'\033[33mGenerating Makefile.depend\033[0m\n'
313 @echo
'# AUTOGENERATED! DO NOT EDIT!!!' >Makefile.depend
314 @
$(CC
) $(CFLAGS
) $(MCCOBJS
:$(OBJDIR
)/mcc
/%.o
=.
/%.c
) -MM
>>Makefile.depend
315 @
$(SED
) -i
's,^\([^$$].*\)\.o: ,$$\(OBJDIR\)/mcc/\1.o: ,g' Makefile.depend
316 @
$(CC
) $(CFLAGS
) $(MCCVOBJS
:$(OBJDIR
)/mccv
/%.o
=.
/%.c
) -MM
>>Makefile.depend
317 @
$(SED
) -i
's,^\([^$$].*\)\.o: ,$$\(OBJDIR\)/mccv/\1.o: ,g' Makefile.depend
318 @echo
'# AUTOGENERATED! DO NOT EDIT!!!' >>Makefile.depend
324 -$(RM
) $(MCCTARGET
) $(MCCTARGET
).debug
$(MCCTARGET
).map
325 -$(RM
) $(MCCVTARGET
) $(MCCVTARGET
).debug
$(MCCVTARGET
).map
326 -$(RM
) $(TESTTARGET
) $(TESTTARGET
).debug
$(TESTTARGET
).map
327 -$(RM
) $(MCCOBJS
) $(MCCVOBJS
) $(TESTOBJS
) $(M68KSTUBS
)
331 -$(RMDIR
) $(OBJDIR
)/mccv
332 -$(RMDIR
) $(OBJDIR
)/mcc
336 ## DEPENDENCY INCLUDE #################
338 -include Makefile.depend