From 957d6601bdd4b4b50f7a774f85676f3b7eb685ed Mon Sep 17 00:00:00 2001 From: John Tytgat Date: Mon, 11 Jun 2007 20:47:18 +0000 Subject: - Reduced compiler warnings: - got rid of aliasing warnings by introducing an extra (void *) casting. - format specifier for 'size_t' type has now 'z' attribute - Injected const attributes (also changing public type rufl_family_list @ rufl.h) - makefile: - support for GCCSDK 3.4 (AOF) and GCCSDK 4 (ELF) based on AB_ELFBUILD (= a variable also used in GCCSDK Autobuilder). - changed the library name from rufl.o to librufl.a. Needed for GCCSDK 4 but if you're using -L -lrufl in your link line, this rename make that this works for both GCCSDK 3.4 and GCCSDK 4. [ Also changes for the Norcroft case which haven't been verified and probably no longer working. ] svn path=/trunk/rufl/; revision=3343 --- makefile | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 1d8e6da..8c86381 100644 --- a/makefile +++ b/makefile @@ -14,29 +14,44 @@ SOURCE = rufl_init.c rufl_quit.c rufl_dump_state.c \ rufl_character_set_test.c \ rufl_paint.c rufl_glyph_map.c rufl_invalidate_cache.c \ rufl_find.c rufl_decompose.c rufl_metrics.c +HDRS = rufl.h rufl_internal.h +ifeq (${AB_ELFBUILD},yes) +EXEEXT=,e1f +else +EXEEXT=,ff8 +endif + +.PHONY: all install clean ifeq ($(COMPILER), gcc) # cross-compiling using GCCSDK GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin GCCSDK_INSTALL_ENV ?= /home/riscos/env - +ifeq (${AB_ELFBUILD},yes) +CC = $(GCCSDK_INSTALL_CROSSBIN)/arm-unknown-riscos-gcc +AR = $(GCCSDK_INSTALL_CROSSBIN)/arm-unknown-riscos-ar +else CC = $(GCCSDK_INSTALL_CROSSBIN)/gcc +AR = $(GCCSDK_INSTALL_CROSSBIN)/ar +endif CFLAGS = -std=c99 -O3 -W -Wall -Wundef -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations \ -Wnested-externs -Winline -Wno-unused-parameter \ -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include +ARFLAGS = cr LIBS = -L$(GCCSDK_INSTALL_ENV)/lib -lOSLib32 INSTALL = $(GCCSDK_INSTALL_ENV)/ro-install +OBJS = $(SOURCE:.c=.o) -all: rufl.o rufl_test,ff8 rufl_chars,ff8 +all: librufl.a rufl_test$(EXEEXT) rufl_chars$(EXEEXT) -rufl.o: $(SOURCE) rufl.h rufl_internal.h Glyphs - $(CC) $(CFLAGS) -c -o $@ $(SOURCE) +librufl.a: $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) -install: rufl.o - $(INSTALL) rufl.o $(GCCSDK_INSTALL_ENV)/lib/librufl.o +install: librufl.a + $(INSTALL) librufl.a $(GCCSDK_INSTALL_ENV)/lib/librufl.a $(INSTALL) rufl.h $(GCCSDK_INSTALL_ENV)/include/rufl.h else # compiling on RISC OS using Norcroft @@ -49,19 +64,16 @@ MKDLK = makedlk SOURCE += strfuncs.c OBJS = $(SOURCE:.c=.o) -all: rufl.o rufl/pyd rufl_test,ff8 rufl_chars,ff8 -rufl.o: o.rufl -o.rufl: $(OBJS) rufl.h rufl_internal.h Glyphs +all: librufl.a rufl/pyd rufl_test,ff8 rufl_chars,ff8 + +librufl.a: $(OBJS) $(LD) $(LDFLAGS) -o $@ $(OBJS) -o.ruflmodule: ruflmodule.o rufl.o +o.ruflmodule: ruflmodule.o librufl.a $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) ruflmodule.o: ruflmodule.c $(CC) -fn -wp -IPyInc:Include,PyInc:RISCOS,TCPIPLibs:,OSLib: -c $@ $< rufl/pyd: o.ruflmodule $(MKDLK) -s .RISCOS.s.linktab -o $< -d $@ -e initrufl -%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< - endif @@ -69,12 +81,14 @@ endif rufl_glyph_map.c: Glyphs makeglyphs ./makeglyphs < Glyphs > $@ -rufl_test,ff8: rufl_test.c rufl.o +rufl_test$(EXEEXT): rufl_test.c librufl.a $(CC) $(CFLAGS) $(LIBS) -o $@ $^ -rufl_chars,ff8: rufl_chars.c rufl.o +rufl_chars$(EXEEXT): rufl_chars.c librufl.a $(CC) $(CFLAGS) $(LIBS) -o $@ $^ +.c.o: $(HDRS) + $(CC) $(CFLAGS) -c -o $@ $< clean: - -rm rufl.o rufl_glyph_map.c rufl_test,ff8 rufl_chars,ff8 + -rm *.o librufl.a rufl_glyph_map.c rufl_test$(EXEEXT) rufl_chars$(EXEEXT) -- cgit v1.2.3