Stunt: get codesetslib from its own Sourceforge repository.
[cake.git] / workbench / libs / codesetslib / developer / examples / makefile.os4
blobe217f316c742a01fe398f941fec2efba03d4fcae
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 #***************************************************************************/
23 # Programs
24 CC        = ppc-amigaos-gcc
25 STRIP     = ppc-amigaos-strip
26 OBJDUMP   = ppc-amigaos-objdump
27 RM        = rm -f
28 RMDIR     = rm -rf
29 MKDIR     = mkdir
30 CHMOD     = chmod
31 FLEX      = flex
32 FC        = flexcat
34 # Directories
35 PREFIX    = .
36 OBJDIR    = .obj_os4
37 BINDIR    = bin_os4
39 # Compiler/Linker flags
40 CPU      = -mcpu=604e
41 CPUFLAGS = -mmultiple -Wa,-mregnames
42 CDEFS    = -D__CST_VERDATE=\"`date +%d.%m.%Y`\" \
43            -D__CST_VERDAYS="`expr \`date +%s\` / 86400 - 2922`"
44 WARN     = -W -Wall
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
51 LDFLAGS  = $(CPU)
52 LDLIBS   =
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 \
63          $(BINDIR)/b64e \
64          $(BINDIR)/UTF8ToStrHook \
65          $(BINDIR)/DetectCodeset \
66          $(BINDIR)/demo1
69 all: $(BINDIR) $(OBJDIR) $(TARGET)
71 # make the object directories
72 $(OBJDIR):
73         @printf '\033[33mGenerating $@ directory\033[0m\n'
74         @$(MKDIR) $(OBJDIR)
76 # make the binary directories
77 $(BINDIR):
78         @printf '\033[33mGenerating $@ directory\033[0m\n'
79         @$(MKDIR) $(BINDIR)
83 $(OBJDIR)/%.o: %.c
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
118 .PHONY: clean
119 clean:
120         -$(RM) $(TARGET) $(TARGET).debug $(OBJDIR)/*.o
122 .PHONY: distclean
123 distclean: clean
124         -$(RMDIR) $(OBJDIR)
125         -$(RMDIR) $(BINDIR)