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
81
82
83
84
85
86
87
88
89
|
# Component settings
COMPONENT := ttf2f
COMPONENT_VERSION := 0.0.5
COMPONENT_DATE := 03 Aug 2021
# We produce an application binary
COMPONENT_TYPE := binary
# Default frontend is cli
FRONTEND ?= cli
# Setup the tooling
PREFIX ?= /opt/netsurf
NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
include $(NSSHARED)/makefiles/Makefile.tools
# Toolchain flags
WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -Werror #-pedantic
CFLAGS := $(CFLAGS) -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
-I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) -Dasm="__asm"
# Freetype2
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
ifneq ($(PKGCONFIG),)
ifeq ($(HOST),arm-unknown-riscos)
CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) freetype2 --cflags --static)
LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) freetype2 --libs --static)
else
CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) freetype2 --cflags)
LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) freetype2 --libs)
endif
else
CFLAGS := $(CFLAGS) -I$(PREFIX)/include/freetype2
LDFLAGS := $(LDFLAGS) -lfreetype -lz
endif
endif
# OSLib (RISC OS target only)
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
ifeq ($(HOST),arm-unknown-riscos)
CFLAGS := $(CFLAGS) -I$(PREFIX)/include -static
LDFLAGS := $(LDFLAGS) -lOSLib32 -lOSLibSupport32 -static
endif
endif
include $(NSBUILD)/Makefile.top
ifeq ($(HOST),arm-unknown-riscos)
realoutput := $(OUTPUT)
e1f := ,e1f
ifeq ($(EXEEXT),$(e1f))
ff8 := ,ff8
realoutput := $(subst $(EXEEXT),$(ff8),$(OUTPUT))
POST_TARGETS := $(realoutput) $(POST_TARGETS)
$(realoutput): $(OUTPUT)
$(Q)echo " ELF2AIF: $@"
$(Q)$(dir $(CC))elf2aif $(OUTPUT) $@
$(Q)echo " SQUEEZE: $@"
$(Q)$(dir $(CC))squeeze $@
endif
DISTCLEAN_ITEMS := $(DISTCLEAN_ITEMS) ttf2f.zip
.PHONY: riscos-dist
riscos-dist: $(realoutput) $(BUILDDIR)/Res,fae
$(Q)$(CP) $(CPFLAGS) $(realoutput) !TTF2f/!RunImage,ff8
$(Q)$(CP) $(CPFLAGS) $(BUILDDIR)/Res,fae !TTF2f/Res,fae
$(Q)$(dir $(CC))zip -9r, ttf2f.zip !TTF2f
$(Q)$(RM) $(RMFLAGS) !TTF2f/!RunImage,ff8 !TTF2f/Res,fae
__empty :=
__space := $(empty) $(empty)
$(BUILDDIR)/Res,fae: riscos/Res
$(Q)echo " CCRES: $@"
$(Q)$(SED) \
-e 's/__COPYRIGHT_END__/$(word $(words $(COMPONENT_DATE)),$(COMPONENT_DATE))/' \
-e 's/__DATE__/$(subst $(__space),-,$(COMPONENT_DATE))/' \
-e 's/__VERSION__/$(word 1,$(subst ., ,$(COMPONENT_VERSION))).$(subst $(__space),,$(wordlist 2,$(words $(subst ., ,$(COMPONENT_VERSION))),$(subst ., ,$(COMPONENT_VERSION))))/' \
$^ >$(BUILDDIR)/Res.txt
$(Q)$(dir $(CC))ccres $(BUILDDIR)/Res.txt $@
endif
all: $(PRE_TARGETS) $(OUTPUT) $(POST_TARGETS)
# Extra installation rules
|