summaryrefslogtreecommitdiff
path: root/src/parse/properties/Makefile
blob: 6461dda9a5b96bfd7b51664a0bd4e613569ce7ed (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Sources

AUTOGEN_PARSERS := $(shell $(PERL) -pe'$$_="" unless /^([^\#][^:]+):/;$$_=$$1 . " "' $(DIR)properties.gen)

# Dodgy use of define/eval to bypass DIR changing
define build_gen_parser

$(BUILDDIR)/gen_parser: $(DIR)css_property_parser_gen.c
	$$(VQ)$$(ECHO) $$(ECHOFLAGS) " PREPARE: $$@"
	$$(Q)$$(BUILD_CC) -o $$@ $$^

endef

$(eval $(build_gen_parser))

define gen_prop_parser

$(DIR)autogenerated_$1.c: $(DIR)properties.gen $(BUILDDIR)/gen_parser
	$$(VQ)$$(ECHO) $$(ECHOFLAGS) "GENERATE: $$@"
	$$(Q)$$(BUILDDIR)/gen_parser -o $$@ '$(shell $(GREP) "^$1:" $(DIR)properties.gen)'

AUTOGEN_SOURCES := $$(AUTOGEN_SOURCES) autogenerated_$1.c

endef

AUTOGEN_SOURCES :=

$(eval $(foreach PROP,$(AUTOGEN_PARSERS),$(call gen_prop_parser,$(PROP))))



DIR_SOURCES :=				\
	azimuth.c			\
	background.c			\
	background_position.c		\
	border.c			\
	border_color.c			\
	border_spacing.c		\
	border_style.c			\
	border_width.c			\
	clip.c				\
	columns.c			\
	column_rule.c			\
	content.c			\
	cue.c				\
	cursor.c			\
	elevation.c			\
	flex.c				\
	flex_flow.c			\
	font.c				\
	font_family.c			\
	font_weight.c			\
	list_style.c			\
	list_style_type.c		\
	margin.c			\
	opacity.c			\
	outline.c			\
	overflow.c			\
	padding.c			\
	pause.c				\
	play_during.c			\
	properties.c			\
	quotes.c			\
	text_decoration.c		\
	utils.c				\
	voice_family.c

DIR_SOURCES := $(DIR_SOURCES) $(AUTOGEN_SOURCES)

PRE_TARGETS := $(foreach AP,$(AUTOGEN_PARSERS),src/parse/properties/autogenerated_$(AP).c)

DISTCLEAN_ITEMS := $(foreach AP,$(AUTOGEN_PARSERS),src/parse/properties/autogenerated_$(AP).c)

include $(NSBUILD)/Makefile.subdir