summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile111
-rw-r--r--include/libnsgif.h (renamed from libnsgif.h)18
-rw-r--r--src/Makefile4
-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
diff --git a/Makefile b/Makefile
index a865221..dc8eaf9 100644
--- a/Makefile
+++ b/Makefile
@@ -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