summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-08-24 08:06:29 (GMT)
committer John Mark Bell <jmb@netsurf-browser.org>2009-08-24 08:06:29 (GMT)
commit15cdb30e3125ce542289fe385f559799e5abf220 (patch)
tree76ff864a119dc14f1ab434d96bef77320229a863
parent729b244809295dad81e0510f9d0bcd7a4c00ec00 (diff)
downloadlibsvgtiny-15cdb30e3125ce542289fe385f559799e5abf220.tar.gz
libsvgtiny-15cdb30e3125ce542289fe385f559799e5abf220.tar.bz2
Beginnings of port to core buildsystem
svn path=/trunk/libsvgtiny/; revision=9419
-rw-r--r--Makefile98
-rw-r--r--include/svgtiny.h (renamed from svgtiny.h)0
-rw-r--r--src/colors.gperf (renamed from colors.gperf)0
-rw-r--r--src/svgtiny.c (renamed from svgtiny.c)0
-rw-r--r--src/svgtiny_gradient.c (renamed from svgtiny_gradient.c)0
-rw-r--r--src/svgtiny_internal.h (renamed from svgtiny_internal.h)0
-rw-r--r--src/svgtiny_list.c (renamed from svgtiny_list.c)0
-rw-r--r--test/svgtiny_test.c (renamed from svgtiny_test.c)0
8 files changed, 28 insertions, 70 deletions
diff --git a/Makefile b/Makefile
index 8c33b28..40dc091 100644
--- a/Makefile
+++ b/Makefile
@@ -1,74 +1,32 @@
-#
-# This file is part of Libsvgtiny
-# Licensed under the MIT License,
-# http://opensource.org/licenses/mit-license.php
-# Copyright 2008 James Bursa <james@semichrome.net>
-#
-
-SOURCE = svgtiny.c svgtiny_gradient.c svgtiny_list.c colors.c
-HDRS = svgtiny.h svgtiny_internal.h
-
-CFLAGS = -std=c99 -W -Wall -Wundef -Wpointer-arith -Wcast-qual \
- -Wcast-align -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations \
- -Wnested-externs -Winline -Wno-cast-align
-ARFLAGS = cr
-INSTALL = install
-
-ifeq ($(TARGET),riscos)
- GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin
- GCCSDK_INSTALL_ENV ?= /home/riscos/env
- CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
- AR := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
- CFLAGS += -Driscos -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include \
- -I$(GCCSDK_INSTALL_ENV)/include/libxml2
- LIBS = -L$(GCCSDK_INSTALL_ENV)/lib -lxml2 -lz
- ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC)))
- EXEEXT := ,e1f
- SUBTARGET := -elf-
- else
- EXEEXT := ,ff8
- SUBTARGET := -aof-
- endif
- PREFIX = $(GCCSDK_INSTALL_ENV)
+# Component settings
+COMPONENT := svgtiny
+COMPONENT_VERSION := 0.0.1
+# Default to a static library
+COMPONENT_TYPE ?= lib-static
+
+# Setup the tooling
+include build/makefiles/Makefile.tools
+
+# Toolchain flags
+WARNFLAGS := -Wall -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -Werror -pedantic
+ifneq ($(GCCVER),2)
+ WARNFLAGS := $(WARNFLAGS) -Wextra
+endif
+CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
else
- CFLAGS += -g `xml2-config --cflags` -fgnu89-inline
- LIBS = `xml2-config --libs`
- PREFIX = /usr/local
+ # __inline__ is a GCCism
+ CFLAGS := $(CFLAGS) -Dinline="__inline__"
endif
-OBJDIR = build-$(TARGET)$(SUBTARGET)objects
-LIBDIR = build-$(TARGET)$(SUBTARGET)lib
-BINDIR = build-$(TARGET)$(SUBTARGET)bin
-
-OBJS = $(addprefix $(OBJDIR)/, $(SOURCE:.c=.o))
-
-.PHONY: all install clean
-
-all: $(LIBDIR)/libsvgtiny.a $(BINDIR)/svgtiny_test$(EXEEXT) colors.c
-
-$(LIBDIR)/libsvgtiny.a: $(OBJS)
- @echo " LINK:" $@
- @mkdir -p $(LIBDIR)
- @$(AR) $(ARFLAGS) $@ $(OBJS)
-
-$(BINDIR)/svgtiny_test$(EXEEXT): svgtiny_test.c $(LIBDIR)/libsvgtiny.a
- @echo " LINK:" $@
- @mkdir -p $(BINDIR)
- @$(CC) $(CFLAGS) $(LIBS) -o $@ $^
-
-$(OBJDIR)/%.o: %.c $(HDRS)
- @echo " COMPILE:" $<
- @mkdir -p $(OBJDIR)
- @$(CC) $(CFLAGS) -c -o $@ $<
-
-%.c: %.gperf
- @echo " GPERF:" $<
- @gperf --output-file=$@ $<
-
-install: $(LIBDIR)/libsvgtiny.a
- $(INSTALL) -t $(PREFIX)/lib $(LIBDIR)/libsvgtiny.a
- $(INSTALL) -t $(PREFIX)/include svgtiny.h
+include build/makefiles/Makefile.top
-clean:
- -rm -rf $(OBJDIR) $(LIBDIR) $(BINDIR) colors.c
+# Extra installation rules
+I := /include
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/svgtiny.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
+INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(OUTPUT)
diff --git a/svgtiny.h b/include/svgtiny.h
index 133086c..133086c 100644
--- a/svgtiny.h
+++ b/include/svgtiny.h
diff --git a/colors.gperf b/src/colors.gperf
index 89152d2..89152d2 100644
--- a/colors.gperf
+++ b/src/colors.gperf
diff --git a/svgtiny.c b/src/svgtiny.c
index ab6b6dd..ab6b6dd 100644
--- a/svgtiny.c
+++ b/src/svgtiny.c
diff --git a/svgtiny_gradient.c b/src/svgtiny_gradient.c
index be4f256..be4f256 100644
--- a/svgtiny_gradient.c
+++ b/src/svgtiny_gradient.c
diff --git a/svgtiny_internal.h b/src/svgtiny_internal.h
index f07f430..f07f430 100644
--- a/svgtiny_internal.h
+++ b/src/svgtiny_internal.h
diff --git a/svgtiny_list.c b/src/svgtiny_list.c
index 53cfb34..53cfb34 100644
--- a/svgtiny_list.c
+++ b/src/svgtiny_list.c
diff --git a/svgtiny_test.c b/test/svgtiny_test.c
index 2a2c862..2a2c862 100644
--- a/svgtiny_test.c
+++ b/test/svgtiny_test.c