diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-29 01:38:08 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-29 01:38:08 +0000 |
commit | 0e9f500cdd1193c6c32c7fc460453f830fdeff1a (patch) | |
tree | 2eccdb5ec1811f39018c08db4c3f8a8e533c63f2 | |
parent | 68a1ebce3438ee4fc2a2ba5b0236f56d9eec244f (diff) | |
download | libnsgif-0e9f500cdd1193c6c32c7fc460453f830fdeff1a.tar.gz libnsgif-0e9f500cdd1193c6c32c7fc460453f830fdeff1a.tar.bz2 |
First cut at a port to the core buildsystem
svn path=/trunk/libnsgif/; revision=6983
-rw-r--r-- | Makefile | 111 | ||||
-rw-r--r-- | include/libnsgif.h (renamed from libnsgif.h) | 18 | ||||
-rw-r--r-- | src/Makefile | 4 | ||||
-rw-r--r-- | src/libnsgif.c (renamed from libnsgif.c) | 0 | ||||
-rw-r--r-- | src/utils/log.h (renamed from utils/log.h) | 0 |
5 files changed, 29 insertions, 104 deletions
@@ -1,90 +1,21 @@ -# -# This file is part of Libnsgif -# - -SOURCE = libnsgif.c -HDRS = libnsgif.h utils/log.h - -CFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ - -Wwrite-strings -Wstrict-prototypes \ - -Wnested-externs -pedantic -std=c99 \ - -Wno-format-zero-length -Wformat-security -Wstrict-aliasing=2 \ - -Wmissing-format-attribute -Wunused -Wunreachable-code \ - -Wformat=2 -Werror-implicit-function-declaration \ - -Wmissing-declarations -Wmissing-prototypes -ARFLAGS = -cr -INSTALL = install -SED = sed -DOXYGEN = doxygen - -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 - LIBS = -L$(GCCSDK_INSTALL_ENV)/lib - ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC))) - EXEEXT := ,e1f - SUBTARGET := -elf- - else - EXEEXT := ,ff8 - SUBTARGET := -aof- - endif - PREFIX = $(GCCSDK_INSTALL_ENV) -else - CFLAGS += -g - LIBS = - PREFIX = /usr/local -endif - --include Makefile.config - -OBJDIR = build-$(TARGET)$(SUBTARGET)objects -LIBDIR = build-$(TARGET)$(SUBTARGET)lib -BINDIR = build-$(TARGET)$(SUBTARGET)bin - -OBJS = $(addprefix $(OBJDIR)/, $(SOURCE:.c=.o)) - -.PHONY: all clean docs install uninstall - -all: $(LIBDIR)/libnsgif.a $(BINDIR)/decode_gif$(EXEEXT) - -$(LIBDIR)/libnsgif.a: $(OBJS) $(LIBDIR)/libnsgif.pc - @echo " LINK:" $@ - @mkdir -p $(LIBDIR) - @$(AR) $(ARFLAGS) $@ $(OBJS) - -$(LIBDIR)/libnsgif.pc: libnsgif.pc.in - @echo " SED:" $@ - @mkdir -p $(LIBDIR) - @$(SED) -e 's#PREFIX#$(PREFIX)#' $^ > $@ - -$(BINDIR)/decode_gif$(EXEEXT): examples/decode_gif.c $(LIBDIR)/libnsgif.a - @echo " LINK:" $@ - @mkdir -p $(BINDIR) - @$(CC) $(CFLAGS) -I. -o $@ $^ - -$(OBJDIR)/%.o: %.c $(HDRS) - @echo " COMPILE:" $< - @mkdir -p $(OBJDIR) - @$(CC) $(CFLAGS) -c -o $@ $< - -docs: - ${DOXYGEN} - -install: $(LIBDIR)/libnsgif.a $(LIBDIR)/libnsgif.pc - mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig - mkdir -p $(DESTDIR)$(PREFIX)/lib - mkdir -p $(DESTDIR)$(PREFIX)/include - $(INSTALL) -m 644 $(LIBDIR)/libnsgif.a $(DESTDIR)$(PREFIX)/lib - $(INSTALL) -m 644 libnsgif.h $(DESTDIR)$(PREFIX)/include - $(INSTALL) -m 644 $(LIBDIR)/libnsgif.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig - -uninstall: - rm $(DESTDIR)$(PREFIX)/lib/libnsgif.a - rm $(DESTDIR)$(PREFIX)/include/libnsgif.h - rm $(DESTDIR)$(PREFIX)/lib/pkgconfig/libnsgif.pc - -clean: - -rm -rf $(OBJDIR) $(LIBDIR) $(BINDIR) doc +# Component settings +COMPONENT := nsgif +# Default to a static library +COMPONENT_TYPE ?= lib-static + +# Setup the tooling +include build/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 -I$(CURDIR)/include/ \ + -I$(CURDIR)/src $(WARNFLAGS) + +include build/makefiles/Makefile.top + +# Extra installation rules +INSTALL_ITEMS := $(INSTALL_ITEMS) /include:include/libnsgif.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(BUILDDIR)/lib$(COMPONENT)$(LIBEXT) diff --git a/libnsgif.h b/include/libnsgif.h index 1710601..f60cc13 100644 --- a/libnsgif.h +++ b/include/libnsgif.h @@ -1,20 +1,10 @@ /* - * Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net> + * Copyright 2004 Richard Wilson <richard.wilson@netsurf-browser.org> * Copyright 2008 Sean Fox <dyntryx@gmail.com> * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * This file is part of NetSurf's libnsgif, http://www.netsurf-browser.org/ + * Licenced under the MIT License, + * http://www.opensource.org/licenses/mit-license.php */ /** \file diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..2a6f584 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,4 @@ +# Sources +DIR_SOURCES := libnsgif.c + +include build/makefiles/Makefile.subdir diff --git a/libnsgif.c b/src/libnsgif.c index 1eb46c5..1eb46c5 100644 --- a/libnsgif.c +++ b/src/libnsgif.c diff --git a/utils/log.h b/src/utils/log.h index 1413374..1413374 100644 --- a/utils/log.h +++ b/src/utils/log.h |