summaryrefslogtreecommitdiff
path: root/src/parse/properties/Makefile
blob: 2cc192ecf521b20fa4239f6a93463912c9cbe0ee (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
# Sources
#	background.c 
#	border.c 
#	border_color.c 
# 	border_style.c 
# 	border_width.c 
# 	content.c 
# 	cue.c 
#	cursor.c 
# 	font.c 
#	font_family.c 
# 	list_style.c 
# 	margin.c 
# 	outline.c 
#	padding.c 
#	pause.c 
# 	play_during.c 
#	quotes.c 
# 	text_decoration.c 
# 	voice_family.c 

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)$$(HOST_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 text_decoration.c background.c			\
	background_position.c border_spacing.c font.c outline.c		\
	voice_family.c border_style.c cue.c				\
	font_family.c list_style.c padding.c cursor.c			\
	list_style_type.c pause.c border.c border_width.c margin.c	\
	play_during.c clip.c properties.c border_color.c content.c	\
	elevation.c font_weight.c quotes.c utils.c opacity.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 build/makefiles/Makefile.subdir