summaryrefslogtreecommitdiff
path: root/Makefile-riscos
blob: 90119648eaa06eea556b0875271a019c3fd6a483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Toolchain definitions for building for RISC OS using the GCCSDK cross-compiler
GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin
GCCSDK_INSTALL_ENV ?= /home/riscos/env

HOST_CC := gcc

CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
AR := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
LD := $(CC)

CP := cp
RM := rm
MKDIR := mkdir
MV := mv
ECHO := echo
MAKE := make
PERL := perl
PKGCONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
INSTALL := install
SED := sed
TOUCH := touch
LCOV := echo
GENHTML := echo
# Filthy hack, as cmunge has the gcc binary name hardcoded, but only looks 
# for gcc in the current path, and not in GCCSDK_INSTALL_CROSSBIN.
CMHG := PATH="$(GCCSDK_INSTALL_CROSSBIN):${PATH}" $(GCCSDK_INSTALL_CROSSBIN)/cmunge

# Toolchain flags
WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
	-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
	-Wmissing-declarations -Wnested-externs -Werror -pedantic
CFLAGS = -std=c99 -D_BSD_SOURCE -I$(TOP)/include/ $(WARNFLAGS) \
	-mpoke-function-name -mmodule
RELEASECFLAGS = $(CFLAGS) -DNDEBUG -O2
DEBUGCFLAGS = $(CFLAGS) -O0 -g
ARFLAGS := -cru
LDFLAGS = -mmodule -L$(TOP)/ -L$(TOP)/unicode/libro

CPFLAGS :=
RMFLAGS := -f
MKDIRFLAGS := -p
MVFLAGS := 
ECHOFLAGS := 
MAKEFLAGS :=
PKGCONFIGFLAGS :=
TOUCHFLAGS :=
CMHGFLAGS := -p -tgcc -32bit

EXEEXT := ,ffa

# Default installation prefix
PREFIX ?= $(GCCSDK_INSTALL_ENV)

TARGET := riscos

include build/Makefile.common

# And the RISC OS distribution targets

ITEMS_DISTCLEAN := $(ITEMS_DISTCLEAN) iconv.zip iconv-pkg.zip

riscos-dist: module aliases
	@svn export riscos riscos-dist
	@$(CP) $(CPFLAGS) riscos/!Boot/Resources/!Unicode/Files/Aliases \
			riscos-dist/!Boot/Resources/!Unicode/Files/
	@$(CP) $(CPFLAGS) Iconv,ffa riscos-dist/!System/310/Modules/
	@svn export doc riscos-dist/doc
	@$(RM) $(RMFLAGS) -r riscos-dist/doc/Standards
	@$(CP) $(CPFLAGS) include/iconv/iconv.h riscos-dist/stubs/
	@(cd riscos-dist ; $(GCCSDK_INSTALL_ENV)/bin/zip -9r, ../iconv.zip *)
	@$(MV) $(MVFLAGS) riscos-dist/!Boot/Resources riscos-dist
	@$(RM) $(RMFLAGS) -r riscos-dist/!Boot
	@$(MV) $(MVFLAGS) riscos-dist/!System riscos-dist/System
	@$(RM) $(RMFLAGS) -r riscos-dist/doc riscos-dist/stubs 
	@$(RM) $(RMFLAGS) riscos-dist/ReadMe
	@svn export riscpkg/RiscPkg riscos-dist/RiscPkg
	@$(CP) $(CPFLAGS) COPYING riscos-dist/RiscPkg/Copyright
	@(cd riscos-dist ; $(GCCSDK_INSTALL_ENV)/bin/zip -9r, ../iconv-pkg.zip *)
	@$(RM) $(RMFLAGS) -r riscos-dist