1 #/***************************************************************************
3 # codesets.library - Amiga shared library for handling different codesets
4 # Copyright (C) 2001-2005 by Alfonso [alfie] Ranieri <alforan@tin.it>.
5 # Copyright (C) 2005-2007 by codesets.library 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 # codesets.library project: http://sourceforge.net/projects/codesetslib/
19 # $Id: makefile.mos 62 2007-01-23 08:55:18Z damato $
21 #***************************************************************************/
25 STRIP = ppc-morphos-strip
26 OBJDUMP = ppc-morphos-objdump
39 # Compiler/Linker flags
42 CDEFS = -D__CST_VERDATE=\"`date +%d.%m.%Y`\" \
43 -D__CST_VERDAYS="`expr \`date +%s\` / 86400 - 2922`"
45 OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops
46 DEBUG = -DDEBUG #-g3 -O0
48 CFLAGS = -noixemul -I. -I../include -I../../include $(CPU) $(CPUFLAGS) $(WARN) $(OPTFLAGS) \
49 $(DEBUG) $(REDEFINE) -c
50 LDFLAGS = $(CPU) -noixemul
53 # CPU and DEBUG can be defined outside, defaults to above
54 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug PPC-603e version
56 # OPTFLAGS are disabled by DEBUG normally!
58 # ignored warnings are:
59 # none - because we want to compile with -Wall all the time
61 TARGET = $(BINDIR)/b64d \
63 $(BINDIR)/UTF8ToStrHook \
64 $(BINDIR)/DetectCodeset \
68 all: $(BINDIR) $(OBJDIR) $(TARGET)
70 # make the object directories
72 @printf '\033[33mGenerating $@ directory\033[0m\n'
75 # make the binary directories
77 @printf '\033[33mGenerating $@ directory\033[0m\n'
83 @printf '\033[32mCompiling $<\033[0m\n'
84 @$(CC) $(CFLAGS) $< -o $@ -DUSE_INLINE_STDARG
88 $(BINDIR)/b64d: $(OBJDIR)/b64d.o
89 @printf '\033[32mLinking \033[1m$@\033[0m\n'
90 @$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
92 $(BINDIR)/b64e: $(OBJDIR)/b64e.o
93 @printf '\033[32mLinking \033[1m$@\033[0m\n'
94 @$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
96 $(BINDIR)/UTF8ToStrHook: $(OBJDIR)/UTF8ToStrHook.o
97 @printf '\033[32mLinking \033[1m$@\033[0m\n'
98 @$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
100 $(BINDIR)/DetectCodeset: $(OBJDIR)/DetectCodeset.o
101 @printf '\033[32mLinking \033[1m$@\033[0m\n'
102 @$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
104 $(BINDIR)/demo1: demo1.c
105 @printf '\033[32mCompiling demo1.c\033[0m\n'
106 @$(CC) $(CFLAGS) demo1.c -o $(OBJDIR)/demo1.o -DNO_PPCINLINE_STDARG
107 @printf '\033[32mLinking \033[1m$@\033[0m\n'
108 @$(CC) $(LDFLAGS) -o $@.debug $(OBJDIR)/demo1.o $(LDLIBS) -lmui
109 @$(STRIP) -o $@ $@.debug
115 -$(RM) $(TARGET) $(TARGET).debug $(OBJDIR)/*.o