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.os4 67 2007-06-05 16:13:07Z thboeckel $
21 #***************************************************************************/
25 STRIP = ppc-amigaos-strip
26 OBJDUMP = ppc-amigaos-objdump
39 # Compiler/Linker flags
41 CPUFLAGS = -mmultiple -Wa,-mregnames
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
47 REDEFINE = -DCoerceMethod=ICoerceMethod -DDoMethod=IDoMethod \
48 -DDoSuperMethod=IDoSuperMethod -DDoSuperMethodA=IDoSuperMethodA
49 CFLAGS = -I. -I../include -I../../include $(CPU) $(CPUFLAGS) $(WARN) $(OPTFLAGS) \
50 $(DEBUG) -D__USE_INLINE__ $(REDEFINE) -c
54 # CPU and DEBUG can be defined outside, defaults to above
55 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug PPC-603e version
57 # OPTFLAGS are disabled by DEBUG normally!
59 # ignored warnings are:
60 # none - because we want to compile with -Wall all the time
62 TARGET = $(BINDIR)/b64d \
64 $(BINDIR)/UTF8ToStrHook \
65 $(BINDIR)/DetectCodeset \
69 all: $(BINDIR) $(OBJDIR) $(TARGET)
71 # make the object directories
73 @printf '\033[33mGenerating $@ directory\033[0m\n'
76 # make the binary directories
78 @printf '\033[33mGenerating $@ directory\033[0m\n'
84 @printf '\033[32mCompiling $<\033[0m\n'
85 @$(CC) $(CFLAGS) $< -o $@
89 $(BINDIR)/b64d: $(OBJDIR)/b64d.o
90 @printf '\033[32mLinking \033[1m$@\033[0m\n'
91 @$(CC) $(LDFLAGS) -o $@.debug $< $(LDLIBS)
92 @$(STRIP) -o $@ $@.debug
94 $(BINDIR)/b64e: $(OBJDIR)/b64e.o
95 @printf '\033[32mLinking \033[1m$@\033[0m\n'
96 @$(CC) $(LDFLAGS) -o $@.debug $< $(LDLIBS)
97 @$(STRIP) -o $@ $@.debug
99 $(BINDIR)/UTF8ToStrHook: $(OBJDIR)/UTF8ToStrHook.o
100 @printf '\033[32mLinking \033[1m$@\033[0m\n'
101 @$(CC) $(LDFLAGS) -o $@.debug $< $(LDLIBS)
102 @$(STRIP) -o $@ $@.debug
104 $(BINDIR)/DetectCodeset: $(OBJDIR)/DetectCodeset.o
105 @printf '\033[32mLinking \033[1m$@\033[0m\n'
106 @$(CC) $(LDFLAGS) -o $@.debug $< $(LDLIBS)
107 @$(STRIP) -o $@ $@.debug
109 $(BINDIR)/demo1: demo1.c
110 @printf '\033[32mCompiling demo1.c\033[0m\n'
111 @$(CC) $(CFLAGS) demo1.c -o $(OBJDIR)/demo1.o
112 @printf '\033[32mLinking \033[1m$@\033[0m\n'
113 @$(CC) $(LDFLAGS) -o $@.debug $(OBJDIR)/demo1.o $(LDLIBS)
114 @$(STRIP) -o $@ $@.debug
120 -$(RM) $(TARGET) $(TARGET).debug $(OBJDIR)/*.o