From d07389640527793522ef553ce974fdd46f15c8f0 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 4 Sep 2012 18:15:34 +0100 Subject: start using core buildsystem --- Makefile | 18 ++++++++++++++++ src/Makefile | 61 +++++++++++++++++++++++++++++++++++----------------- src/genbind-lexer.l | 2 -- src/genbind-parser.y | 4 +--- src/webidl-lexer.l | 2 -- src/webidl-parser.y | 4 +--- 6 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..27703b9 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# Define the component name +COMPONENT := genjsbind +# And the component type +COMPONENT_TYPE := binary +# Component version +COMPONENT_VERSION := 0.0.1 + +# Tooling +PREFIX ?= /opt/netsurf +NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem +include $(NSSHARED)/makefiles/Makefile.tools + +# Grab the core makefile +include $(NSBUILD)/Makefile.top + +# Add extra install rules for our pkg-config control file and the library itself +#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in +#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(BUILDDIR)/lib$(COMPONENT)$(LIBEXT) diff --git a/src/Makefile b/src/Makefile index c0feb20..04e677a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,37 +1,58 @@ # -CFLAGS+=-Wall +#CFLAGS+=-Wall -.PHONY: all clean +#.PHONY: all clean -all: genjsbind +#all: genjsbind -genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o - $(CC) -o $@ $^ +#genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o +# $(CC) -o $@ $^ -webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h +#webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h -webidl-parser.h webidl-parser.c: webidl-parser.y - bison -t $< +#webidl-parser.h webidl-parser.c: webidl-parser.y +# bison -t $< -webidl-lexer.h: webidl-lexer.c +#webidl-lexer.h: webidl-lexer.c -webidl-lexer.c: webidl-lexer.l - flex $< +#webidl-lexer.c: webidl-lexer.l +# flex $< -genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h +#genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h -genbind-parser.h genbind-parser.c: genbind-parser.y - bison -t $< +#genbind-parser.h genbind-parser.c: genbind-parser.y +# bison -t $< -genbind-lexer.h: genbind-lexer.c +#genbind-lexer.h: genbind-lexer.c -genbind-lexer.c: genbind-lexer.l - flex $< +#genbind-lexer.c: genbind-lexer.l +# flex $< -genjsbind.o: webidl-parser.h genbind-parser.h +#genjsbind.o: webidl-parser.h genbind-parser.h -clean: - $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o +#clean: +# $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o + +CFLAGS+=-I$(BUILDDIR) + +$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l + $(VQ)$(ECHO) " FLEX: $<" + $(Q)flex --outfile=$(BUILDDIR)/$(*F)-lexer.c --header-file=$(BUILDDIR)/$(*F)-lexer.h $< + +$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-parser.h + +$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y + $(VQ)$(ECHO) " BISON: $<" + $(Q)bison -d -t --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $< + + +# Sources in this directory +DIR_SOURCES := genjsbind.c + +SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c + +# Grab the core makefile +include $(NSBUILD)/Makefile.subdir diff --git a/src/genbind-lexer.l b/src/genbind-lexer.l index 010a384..6150f09 100644 --- a/src/genbind-lexer.l +++ b/src/genbind-lexer.l @@ -3,8 +3,6 @@ */ /* lexer options */ -%option outfile="genbind-lexer.c" -%option header-file="genbind-lexer.h" %option never-interactive %option bison-bridge %option nodefault diff --git a/src/genbind-parser.y b/src/genbind-parser.y index 309f01e..42330f7 100644 --- a/src/genbind-parser.y +++ b/src/genbind-parser.y @@ -28,10 +28,8 @@ int genbind_wrap() %} -%output "genbind-parser.c" -%defines "genbind-parser.h" - %define api.pure +%define api.prefix "genbind_" %name-prefix "genbind_" %union diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l index f605575..1d2db67 100644 --- a/src/webidl-lexer.l +++ b/src/webidl-lexer.l @@ -10,8 +10,6 @@ */ /* lexer options */ -%option outfile="webidl-lexer.c" -%option header-file="webidl-lexer.h" %option never-interactive %option yylineno %option bison-bridge diff --git a/src/webidl-parser.y b/src/webidl-parser.y index d5859ff..bcc93ba 100644 --- a/src/webidl-parser.y +++ b/src/webidl-parser.y @@ -30,11 +30,9 @@ int webidl_wrap() %} -%output "webidl-parser.c" -%defines "webidl-parser.h" - %locations %define api.pure +%define api.prefix "webidl_" %name-prefix "webidl_" %union -- cgit v1.2.3