1 #/***************************************************************************
3 # NListview.mcc - New Listview MUI Custom Class
4 # Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F)
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
118 # override commands for native builds
119 ifeq ($(HOST
), AmigaOS4
)
122 # RMDIR = delete force all
126 ifeq ($(HOST
), AmigaOS
)
129 RMDIR
= delete
force all
132 ifeq ($(HOST
), MorphOS
)
135 RMDIR
= delete
force all
145 # override some variables for non-native builds (cross-compiler)
146 ifneq ($(HOST
), AmigaOS
)
147 ifneq ($(HOST
), AmigaOS4
)
148 ifneq ($(HOST
), MorphOS
)
150 # when we end up here this is either a unix or Aros host
151 # so lets use unix kind of commands
165 ###########################################################################
166 # CPU and DEBUG can be defined outside, defaults to above
167 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug
170 # OPTFLAGS are disabled by DEBUG normally!
172 # ignored warnings are:
173 # none - because we want to compile with -Wall all the time
181 DEPFILE
= Makefile.dep
182 DESTDIR
= MUI
:Libs
/MUI
185 TARGET
= $(BINDIR
)/NListviews.mcp
186 TESTTARGET
= $(BINDIR
)/NListviews-Prefs
188 # Common compiler/linker flags
189 WARN
= -W
-Wall
-Wwrite-strings
-Wpointer-arith
-Wsign-compare
190 OPTFLAGS
= -O3
-fomit-frame-pointer
191 DEBUG
= -DDEBUG
-fno-omit-frame-pointer
-O0
192 DEBUGSYM
= -g
-gstabs
193 CFLAGS
= -I.
-I..
/nlistviews_mcp
-I..
/include $(CPU
) $(WARN
) \
194 $(OPTFLAGS
) $(DEBUG
) $(DEBUGSYM
) $(USER_CFLAGS
) -c
195 LDFLAGS
= $(CPU
) $(DEBUGSYM
)
198 ###########################################################################
199 # object files definition
209 TOBJS
= NListviews-Prefs.o
211 MCCOBJS
= $(addprefix $(OBJDIR
)/,$(LOBJS
)) $(addprefix $(OBJDIR
)/,$(COBJS
))
212 TESTOBJS
= $(addprefix $(OBJDIR
)/,$(COBJS
)) $(addprefix $(OBJDIR
)/,$(TOBJS
))
214 # available catalog translations
215 CATALOGS
= $(patsubst %.po
,%.catalog
,$(wildcard $(LOCALE
)/*.po
))
217 # different options per target OS
220 ##############################
223 # Compiler/link/strip commands
224 ifneq ($(HOST
), AmigaOS4
)
226 STRIP
= ppc-amigaos-strip
227 OBJDUMP
= ppc-amigaos-objdump
230 # Compiler/Linker flags
233 WARN
+= -Wdeclaration-after-statement
-Wdisabled-optimization
234 CFLAGS
+= -mcrt
=$(CRT
) -D__USE_INLINE__
-D__NEW_TIMEVAL_DEFINITION_USED__ \
235 -DNO_PPCINLINE_STDARG
-Wa
,-mregnames
236 LDFLAGS
+= -mcrt
=$(CRT
)
238 # additional object files required
239 M68KSTUBS
= $(OBJDIR
)/mccclass_68k.o
244 ##############################
247 # Compiler/link/strip commands
248 ifneq ($(HOST
), AmigaOS
)
249 CC
= m68k-amigaos-gcc
250 STRIP
= m68k-amigaos-strip
251 OBJDUMP
= m68k-amigaos-objdump
254 # Compiler/Linker flags
255 CPU
= -m68020-60
-msoft-float
256 CFLAGS
+= -noixemul
-DNO_INLINE_STDARG
-D__amigaos3__
258 LDLIBS
+= -ldebug
-lmui
260 # additional object files required
266 ##############################
269 # Compiler/link/strip commands
270 ifneq ($(HOST
), MorphOS
)
272 STRIP
= ppc-morphos-strip
273 OBJDUMP
= ppc-morphos-objdump
276 # Compiler/Linker flags
278 CFLAGS
+= -noixemul
-DNO_PPCINLINE_STDARG
283 ifeq ($(OS
), aros-i386
)
285 ##############################
288 ifneq ($(HOST
), AROS
)
290 STRIP
= i386-aros-strip
291 OBJDUMP
= i386-aros-objdump
294 # Compiler/Linker flags
295 OPTFLAGS
= -O2
-fomit-frame-pointer
296 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
297 LDLIBS
+= -larossupport
-lrom
-lmui
300 ifeq ($(OS
), aros-ppc
)
302 ##############################
305 ifneq ($(HOST
), AROS
)
307 STRIP
= ppc-aros-strip
308 OBJDUMP
= ppc-aros-objdump
311 # Compiler/Linker flags
312 OPTFLAGS
= -O2
-fomit-frame-pointer
313 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
314 LDLIBS
+= -larossupport
-lrom
-lmui
317 ifeq ($(OS
), aros-x86_64
)
319 ##############################
322 ifneq ($(HOST
), AROS
)
324 STRIP
= x86_64-aros-strip
325 OBJDUMP
= x86_64-aros-objdump
328 # Compiler/Linker flags
329 OPTFLAGS
= -O2
-fomit-frame-pointer
330 CFLAGS
+= -Wno-pointer-sign
-DNO_INLINE_STDARG
331 LDLIBS
+= -larossupport
-lrom
-lmui
342 ifeq ($(wildcard $(DEPFILE
)),$(DEPFILE
))
343 # great, we have a dependecies file, let's make our target
344 all: $(BINDIR
) $(OBJDIR
) $(M68KSTUBS
) locale.c
$(TARGET
) $(TESTTARGET
)
346 # no dependecies, create it and then call make again
348 @make
--no-print-directory
all
351 # for making a release we compile ALL target with no debug
363 make OS
=aros-i386
clean
364 make OS
=aros-i386 DEBUG
=
366 make OS
=aros-ppc
clean
367 make OS
=aros-ppc DEBUG
=
369 make OS
=aros-x86_64
clean
370 make OS
=aros-x86_64 DEBUG
=
372 # make the object directories
377 # make the binary directories
382 # for compiling single .c files
385 @
$(CC
) $(CFLAGS
) $< -o
$@
387 $(OBJDIR
)/mccclass_68k.o
: ..
/include/mccclass_68k.c
389 @
$(CC
) $(CFLAGS
) $< -o
$@
391 # for linking the target
392 $(TARGET
): $(M68KSTUBS
) $(MCCOBJS
)
394 @
$(CC
) -nostartfiles
$(LDFLAGS
) -o
$@.debug
$(MCCOBJS
) $(M68KSTUBS
) $(LDLIBS
) -Wl
,--cref
,-M
,-Map
=$@.map
396 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
398 # for linking the target
399 $(TESTTARGET
): $(TESTOBJS
)
401 @
$(CC
) $(LDFLAGS
) -o
$@.debug
$(TESTOBJS
) $(LDLIBS
) -Wl
,--cref
,-M
,-Map
=$@.map
403 @
$(STRIP
) --preserve-dates
-R.comment
-R.sdata2
-S
-o
$@
$@.debug
406 locale.c
: $(LOCALE
)/NListviews_mcp.pot C_h.sd C_c.sd
408 @
$(FC
) $(LOCALE
)/NListviews_mcp.pot locale.h
=C_h.sd locale.c
=C_c.sd
410 ## CATALOG GENERATION #################
412 $(LOCALE
)/%.catalog
: $(LOCALE
)/%.po
$(LOCALE
)/NListviews_mcp.pot
414 @
$(FC
) POFILE
$< CATALOG
$@
418 catalogs
: $(CATALOGS
)
422 -$(OBJDUMP
) --section-headers
--all-headers
--reloc
--disassemble-all
$(TARGET
) >$(TARGET
).dump
426 -$(RM
) $(TARGET
) $(TARGET
).debug
$(TARGET
).map
427 -$(RM
) $(TESTTARGET
) $(TESTTARGET
).debug
$(TESTTARGET
).map
428 -$(RM
) $(MCCOBJS
) $(TESTOBJS
) $(M68KSTUBS
)
434 -$(RM
) $(LOCALE
)/*.catalog
441 @echo
" IN $(TARGET)"
442 @
$(CP
) $(TARGET
) $(DESTDIR
)
446 @echo
"Cleaning targets:"
447 @echo
" clean - Cleanup working directory for clean compile"
448 @echo
" distclean - Also cleanup autogenerated files"
450 @echo
"Other generic targets:"
451 @echo
" all - Build $(TARGET)"
452 @echo
" catalogs - Build all available catalogs"
454 @echo
"Install targets:"
455 @echo
" install - Install $(TARGET) into $(DESTDIR)"
458 @echo
" make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64"
459 @echo
" make DEBUG= : build $(TARGET) without debugging information"
462 ## DEPENDENCY GENERATION ##############
466 @echo
" MK $(DEPFILE)"
467 @echo
"# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE
)
468 @
$(CC
) -MM
-MG
$(CFLAGS
) $(wildcard *.c
) >>$(DEPFILE
)
469 @echo
"# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE
)
470 @
$(SED
) -i
's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE
)
472 # include dependencies file