blob: 9905baf71b2f70a2177d12ec847ccd6356fd0c5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g -DYYENABLE_NLS=0
# Sources in this directory
DIR_SOURCES := nsgenbind.c utils.c webidl-ast.c nsgenbind-ast.c ir.c \
duk-libdom.c
# jsapi-libdom.c jsapi-libdom-function.c jsapi-libdom-property.c jsapi-libdom-init.c jsapi-libdom-new.c jsapi-libdom-infmap.c jsapi-libdom-jsclass.c
SOURCES := $(SOURCES) $(BUILDDIR)/nsgenbind-parser.c $(BUILDDIR)/nsgenbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
$(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
# Bison 2.6 and later require api.prefix, but this breaks Bison 2.5 and earlier.
bisonvsn := $(word 4,$(shell $(BISON) --version))
bisonmaj := $(word 1,$(subst ., ,$(bisonvsn)))
bisonmin := $(word 2,$(subst ., ,$(bisonvsn)))
ifeq ($(bisonmaj),1)
BISON_DEFINES = --name-prefix=$(*F)_
else
ifeq ($(bisonmaj),2)
ifneq ($(findstring $(bisonmin),"0 1 2 3 4 5"),)
BISON_DEFINES = --name-prefix=$(*F)_
else
BISON_DEFINES = --define=api.prefix=$(*F)_
endif
else
BISON_DEFINES = --define=api.prefix=$(*F)_
endif
endif
$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
$(VQ)$(ECHO) " BISON: $<"
$(Q)$(BISON) -d -t $(BISON_DEFINES) --report=all --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
# Grab the core makefile
include $(NSBUILD)/Makefile.subdir
|