From 5e173f639d10c44567e3dc2c53d459a0b102fb84 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 6 Jan 2010 16:56:04 +0000 Subject: Port to core buildsystem svn path=/trunk/pencil/; revision=9793 --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e93d3d8 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# Component settings +COMPONENT := pencil +COMPONENT_VERSION := 0.0.1 +# Default to a static library +COMPONENT_TYPE ?= lib-static + +# Setup the tooling +include build/makefiles/Makefile.tools + +TESTRUNNER := $(ECHO) + +# Toolchain flags +WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \ + -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ + -Wmissing-declarations -Wnested-externs -pedantic +# BeOS/Haiku/AmigaOS4 standard library headers create warnings +ifneq ($(TARGET),beos) + ifneq ($(TARGET),AmigaOS) + WARNFLAGS := $(WARNFLAGS) -Werror + endif +endif +CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) +ifneq ($(GCCVER),2) + CFLAGS := $(CFLAGS) -std=c99 +else + # __inline__ is a GCCism + CFLAGS := $(CFLAGS) -Dinline="__inline__" +endif + +# OSLib +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) + ifeq ($(TARGET),riscos) + CFLAGS := $(CFLAGS) -I$(PREFIX)/include + LDFLAGS := $(LDFLAGS) -lOSLib32 + endif +endif + +# RUfl +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) + ifneq ($(PKGCONFIG),) + CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) librufl --cflags) + LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) librufl --libs) + else + CFLAGS := $(CFLAGS) -I$(PREFIX)/include + LDFLAGS := $(LDFLAGS) -lrufl + endif +endif + +include build/makefiles/Makefile.top + +# Extra installation rules +I := /include +INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/pencil.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(OUTPUT) -- cgit v1.2.3