1 #/***************************************************************************
3 # NFloattext.mcc - New Floattext MUI Custom Class
4 # Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF)
6 # Copyright (C) 1996-2001 by Gilles Masson
7 # Copyright (C) 2001-2014 NList Open Source Team
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # NList classes Support Site: http://www.sf.net/projects/nlist-classes
23 #***************************************************************************/
25 ###########################################################################
26 # This makefile is a very generic one. It tries to identify both, the host
27 # and the target operating system for which YAM should be compiled.
28 # However, this auto-detection can be easily overridden by directly
29 # specifying an option on the commandline while calling 'make'.
33 # # to explicitly compile for AmigaOS3
36 # # to compile for AmigaOS4 but with debugging
37 # > make OS=os4 DEBUG=
40 #############################################
41 # find out the HOST operating system
42 # on which this makefile is run
43 HOST ?
= $(shell uname
)
44 ifeq ($(HOST
), AmigaOS
)
45 ifeq ($(shell uname
-m
), powerpc
)
48 ifeq ($(shell uname
-m
), ppc
)
53 # if no host is identifed (no uname tool)
54 # we assume a AmigaOS build
59 #############################################
60 # now we find out the target OS for
61 # which we are going to compile YAM in case
62 # the caller didn't yet define OS himself
64 ifeq ($(HOST
), AmigaOS4
)
67 ifeq ($(HOST
), AmigaOS
)
70 ifeq ($(HOST
), MorphOS
)
74 # now we find out which CPU system aros will be used
75 ifeq ($(shell uname
-m
), powerpc
)
78 ifeq ($(shell uname
-m
), ppc
)
81 ifeq ($(shell uname
-m
), i386
)
84 ifeq ($(shell uname
-m
), i686
)
87 ifeq ($(shell uname
-m
), x86_64
)
98 #############################################
99 # define common commands we use in this
100 # makefile. Please note that each of them
101 # might be overridden on the commandline.
109 RMDIR
= delete
force all
111 CHMOD
= protect FLAGS
=rwed
122 # override some variables for non-native builds (cross-compiler)
123 ifneq ($(HOST
), AmigaOS
)
124 ifneq ($(HOST
), AmigaOS4
)
125 ifneq ($(HOST
), MorphOS
)
127 # when we end up here this is either a unix or Aros host
128 # so lets use unix kind of commands
142 ###########################################################################
143 # CPU and DEBUG can be defined outside, defaults to above
144 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug
147 # OPTFLAGS are disabled by DEBUG normally!
149 # ignored warnings are:
150 # none - because we want to compile with -Wall all the time
157 DEPFILE
= Makefile.dep
158 DESTDIR
= MUI
:Libs
/MUI
161 TARGET
= $(BINDIR
)/NFloattext.mcc
162 TESTTARGET
= $(BINDIR
)/NFloattext-Test
164 # Common compiler/linker flags
165 WARN
= -W
-Wall
-Wwrite-strings
-Wpointer-arith
-Wsign-compare
166 OPTFLAGS
= -O3
-fomit-frame-pointer
167 DEBUG
= -DDEBUG
-fno-omit-frame-pointer
-O0
168 DEBUGSYM
= -g
-gstabs
169 CFLAGS
= -I.
-I..
/nlistviews_mcp
-I..
/include $(CPU
) $(WARN
) $(OPTFLAGS
) \
170 $(DEBUG
) $(DEBUGSYM
) $(USER_CFLAGS
) -c
171 LDFLAGS
= $(CPU
) $(DEBUGSYM
)
174 ###########################################################################
175 # object files definition
180 COBJS
= NFloattext.o \
183 TOBJS
= #NFloattext-Test.o
185 MCCOBJS
= $(addprefix $(OBJDIR
)/,$(LOBJS
)) $(addprefix $(OBJDIR
)/,$(COBJS
))
186 TESTOBJS
= $(addprefix $(OBJDIR
)/,$(COBJS
)) $(addprefix $(OBJDIR
)/,$(TOBJS
))
188 # different options per target OS
191 ##############################
194 # Compiler/link/strip commands
195 ifneq ($(HOST
), AmigaOS4
)
197 STRIP
= ppc-amigaos-strip
198 OBJDUMP
= ppc-amigaos-objdump
201 # Compiler/Linker flags
204 WARN
+= -Wdeclaration-after-statement
-Wdisabled-optimization
205 CFLAGS
+= -mcrt
=$(CRT
) -D__USE_INLINE__
-D__NEW_TIMEVAL_DEFINITION_USED__ \
206 -DNO_PPCINLINE_STDARG
-Wa
,-mregnames
207 LDFLAGS
+= -mcrt
=$(CRT
)
209 # additional object files required
210 M68KSTUBS
= $(OBJDIR
)/mccclass_68k.o
215 ##############################
218 # Compiler/link/strip commands
219 ifneq ($(HOST
), AmigaOS
)
220 CC
= m68k-amigaos-gcc
221 STRIP
= m68k-amigaos-strip
222 OBJDUMP
= m68k-amigaos-objdump
225 # Compiler/Linker flags
226 CPU
= -m68020-60
-msoft-float
227 CFLAGS
+= -noixemul
-DNO_INLINE_STDARG
-D__amigaos3__
229 LDLIBS
+= -ldebug
-lmui
234 ##############################
237 # Compiler/link/strip commands
238 ifneq ($(HOST
), MorphOS
)
240 STRIP
= ppc-morphos-strip
241 OBJDUMP
= ppc-morphos-objdump
244 # Compiler/Linker flags
246 CFLAGS
+= -noixemul
-DNO_PPCINLINE_STDARG
251 ifeq ($(OS
), aros-i386
)
253 ##############################
256 ifneq ($(HOST
), AROS
)
258 STRIP
= i386-aros-strip
259 OBJDUMP
= i386-aros-objdump
262 # Compiler/Linker flags
263 OPTFLAGS
= -O2
-fomit-frame-pointer
264 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
265 LDLIBS
+= -larossupport
-lrom
-lmui
268 ifeq ($(OS
), aros-ppc
)
270 ##############################
273 ifneq ($(HOST
), AROS
)
275 STRIP
= ppc-aros-strip
276 OBJDUMP
= ppc-aros-objdump
279 # Compiler/Linker flags
280 OPTFLAGS
= -O2
-fomit-frame-pointer
281 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
282 LDLIBS
+= -larossupport
-lrom
-lmui
285 ifeq ($(OS
), aros-x86_64
)
287 ##############################
290 ifneq ($(HOST
), AROS
)
292 STRIP
= x86_64-aros-strip
293 OBJDUMP
= x86_64-aros-objdump
296 # Compiler/Linker flags
297 OPTFLAGS
= -O2
-fomit-frame-pointer
298 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
299 LDLIBS
+= -larossupport
-lrom
-lmui
310 ifeq ($(wildcard $(DEPFILE
)),$(DEPFILE
))
311 # great, we have a dependecies file, let's make our target
312 all: $(BINDIR
) $(OBJDIR
) $(M68KSTUBS
) $(TARGET
) #$(TESTTARGET)
314 # no dependecies, create it and then call make again
316 @make
--no-print-directory
all
319 # for making a release we compile ALL target with no debug
331 make OS
=aros-i386
clean
332 make OS
=aros-i386 DEBUG
=
334 make OS
=aros-ppc
clean
335 make OS
=aros-ppc DEBUG
=
337 make OS
=aros-x86_64
clean
338 make OS
=aros-x86_64 DEBUG
=
340 # make the object directories
345 # make the binary directories
350 # for compiling single .c files
353 @
$(CC
) $(CFLAGS
) $< -o
$@
355 $(OBJDIR
)/mccclass_68k.o
: ..
/include/mccclass_68k.c
357 @
$(CC
) $(CFLAGS
) $< -o
$@
359 # for linking the target
360 $(TARGET
): $(M68KSTUBS
) $(MCCOBJS
)
362 @
$(CC
) -nostartfiles
$(LDFLAGS
) -o
$@.debug
$(MCCOBJS
) $(M68KSTUBS
) $(LDLIBS
) -Wl
,--cref
,-M
,-Map
=$@.map
364 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
366 # for linking the target
367 $(TESTTARGET
): $(TESTOBJS
)
369 @
$(CC
) $(LDFLAGS
) -o
$@.debug
$(TESTOBJS
) $(LDLIBS
) -Wl
,--cref
,-M
,-Map
=$@.map
371 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
375 -$(OBJDUMP
) --section-headers
--all-headers
--reloc
--disassemble-all
$(TARGET
) >$(TARGET
).dump
379 -$(RM
) $(TARGET
) $(TARGET
).debug
$(TARGET
).map
380 -$(RM
) $(TESTTARGET
) $(TESTTARGET
).debug
$(TESTTARGET
).map
381 -$(RM
) $(MCCOBJS
) $(TESTOBJS
) $(M68KSTUBS
)
391 @echo
" IN $(TARGET)"
392 @
$(CP
) $(TARGET
) $(DESTDIR
)
396 @echo
"Cleaning targets:"
397 @echo
" clean - Cleanup working directory for clean compile"
398 @echo
" distclean - Also cleanup autogenerated files"
400 @echo
"Other generic targets:"
401 @echo
" all - Build $(TARGET)"
402 @echo
" catalogs - Build all available catalogs"
404 @echo
"Install targets:"
405 @echo
" install - Install $(TARGET) into $(DESTDIR)"
408 @echo
" make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64"
409 @echo
" make DEBUG= : build $(TARGET) without debugging information"
412 ## DEPENDENCY GENERATION ##############
416 @echo
" MK $(DEPFILE)"
417 @echo
"# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE
)
418 @
$(CC
) -MM
-MG
$(CFLAGS
) $(wildcard *.c
) >>$(DEPFILE
)
419 @echo
"# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE
)
420 @
$(SED
) -i
's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE
)
422 # include dependencies file