Updated from original SVN.
[cake.git] / workbench / classes / gadgets / texteditor / mcp / Makefile.mos
blobdfbdad20e8cd4817ebd666e4d8681c61109c5b9a
1 #/***************************************************************************
3 # TextEditor.mcc - Textediting MUI Custom Class
4 # Copyright (C) 1997-2000 Allan Odgaard
5 # Copyright (C) 2005 by TextEditor.mcc 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 # TextEditor class Support Site:  http://www.sf.net/projects/texteditor-mcc
19 # $Id: Makefile.mos,v 1.5 2005/06/04 11:57:46 damato Exp $
21 #***************************************************************************/
23 # Programs
24 CC    = ppc-morphos-gcc
25 STRIP = ppc-morphos-strip
26 RM    = rm -f
27 RMDIR = rm -rf
28 MKDIR   = mkdir
29 CP    = cp
30 FC    = flexcat
32 # Directories
33 OBJDIR    = .obj_mos
34 BINDIR    = bin_mos
36 # Compiler/Linker flags
37 CPU      = -mcpu=750
38 CPUFLAGS = -mmultiple
39 CDEFS    = -D__NLVP_VERDATE=\"`date +%d.%m.%Y`\" -D__NLVP_VERDAYS="`expr \`date +%s\` / 86400 - 2922`"
40 WARN     = -W -Wall
41 OPTFLAGS = -O3 -finline-functions -fomit-frame-pointer -funroll-loops
42 DEBUG    = -DDEBUG -g -O0
43 CFLAGS   = -noixemul -I. -I../mcc -I../includes $(CPU) $(CPUFLAGS) $(WARN) $(OPTFLAGS)\
44            $(DEBUG) -c
45 LDFLAGS  = -noixemul -nostartfiles $(CPU)
46 LDLIBS   = -ldebug
48 # CPU and DEBUG can be defined outside, defaults to above
49 # using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug PPC-603e version
51 # OPTFLAGS are disabled by DEBUG normally!
53 # ignored warnings are:
54 # none - because we want to compile with -Wall all the time
57 MCPTARGET = $(BINDIR)/TextEditor.mcp
58 PREFTARGET= $(BINDIR)/TextEditor-Prefs
60 MCPOBJS = $(OBJDIR)/library.o \
61           $(OBJDIR)/locale.o \
62           $(OBJDIR)/CreatePrefsGroup.o \
63           $(OBJDIR)/Debug.o \
64           $(OBJDIR)/Dispatcher.o \
65           $(OBJDIR)/Keybindings.o \
66           $(OBJDIR)/KeyStorage.o \
67           $(OBJDIR)/ObjectCreator.o
69 PREFOBJS =$(OBJDIR)/locale.o \
70           $(OBJDIR)/CreatePrefsGroup.o \
71           $(OBJDIR)/Debug.o \
72           $(OBJDIR)/Dispatcher.o \
73           $(OBJDIR)/Keybindings.o \
74           $(OBJDIR)/KeyStorage.o \
75           $(OBJDIR)/ObjectCreator.o \
76           $(OBJDIR)/Preference.o
80 all: $(BINDIR) $(OBJDIR) locale.c $(MCPTARGET) $(PREFTARGET)
82 # make the object directories
83 $(OBJDIR):
84         @printf '\033[33mGenerating $@ directory\033[0m\n'
85         @$(MKDIR) $(OBJDIR)
87 # make the binary directories
88 $(BINDIR):
89         @printf '\033[33mGenerating $@ directory\033[0m\n'
90         @$(MKDIR) $(BINDIR)
94 $(OBJDIR)/%.o: %.c
95         @printf '\033[32mCompiling $<\033[0m\n'
96         @$(CC) $(CFLAGS) $< -o $@ -DNO_PPCINLINE_STDARG
98 $(LOCALE)/%.catalog: $(LOCALE)/%.ct
99         @printf '\033[33mGenerating $@\033[0m\n'
100         @$(FC) $(LOCALE)/TextEditor_mcp.cd $< CATALOG $@
104 $(MCPTARGET): $(MCPOBJS)
105         @printf '\033[32mLinking \033[1m$@\033[0m\n'
106         @$(CC) $(LDFLAGS) -o $@.debug $(MCPOBJS) $(LDLIBS)
107         @$(STRIP) -o $@ $@.debug
109 $(PREFTARGET): $(PREFOBJS) $(OBJDIR)/Preference.o
110         @printf '\033[32mLinking \033[1m$@\033[0m\n'
111         @$(CC) -noixemul -o $@.debug $(PREFOBJS) $(LDLIBS)
112         @$(STRIP) -o $@ $@.debug
114 $(OBJDIR)/library.o: library.c ../includes/mccheader.c \
115   ../mcc/TextEditor_mcc.h private.h rev.h
117 $(OBJDIR)/library.o: library.c ../includes/mccheader.c TextEditor_mcp.h \
118   private.h icon.bh rev.h
120 locale.h: locale.c
121 locale.c: locale/TextEditor_mcp.cd C_h.sd C_c.sd
122         @printf '\033[33mGenerating locale file $@...\033[0m\n'
123         @$(FC) locale/TextEditor_mcp.cd locale.h=C_h.sd locale.c=C_c.sd
127 .PHONY: clean
128 clean:
129         -$(RM) $(MCPTARGET) $(MCPTARGET).debug $(PREFTARGET) $(PREFTARGET).debug $(MCPOBJS) $(PREFOBJS)
131 .PHONY: distclean
132 distclean: clean
133         -$(RM) locale.?
134         -$(RMDIR) $(OBJDIR)
135         -$(RMDIR) $(BINDIR)