]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/io/server/src/Makefile
update
[l4.git] / l4 / pkg / io / server / src / Makefile
1 PKGDIR          ?= ../..
2 L4DIR           ?= $(PKGDIR)/../..
3
4 include $(L4DIR)/mk/prog.mk
5
6 ifneq ($(filter regen_files,$(MAKECMDGOALS)),)
7
8 BISON ?= bison
9 RAGEL ?= ragel
10
11 SRC_YY := $(SRC_DIR)/cfg_parser.yy
12 CC_YY  := $(SRC_YY:%.yy=%.tab.cc) $(SRC_YY:%.yy=%.tab.hh)
13 # generate scanner in the source dir, to prevent a hard dependency to ragel
14 CC_RL  := $(SRC_DIR)/cfg_scan.cc
15
16 regen_files:: $(CC_RL) $(CC_YY)
17
18 $(CC_RL): %.cc: %.rl $(SRC_DIR)/Makefile
19         @$(GEN_MESSAGE)
20         $(VERBOSE)$(RAGEL) -o $@ $<
21         $(VERBOSE)perl -p -i -e 's/(\#line\s+\d+\s+")\/.*\/(.+")$$/$$1$$2/' $@
22
23 $(SRC_DIR)/%.tab.hh $(SRC_DIR)/%.tab.cc: $(SRC_DIR)/%.yy $(SRC_DIR)/Makefile
24         @$(GEN_MESSAGE)
25         $(VERBOSE)$(BISON) $<
26         $(VERBOSE)perl -p -i -e 's/(\#line\s+\d+\s+")\/.*\/(.+")$$/$$1$$2/' \
27           $(patsubst %.yy,%.tab.cc,$<) $(patsubst %.yy,%.tab.hh,$<)
28
29 .PHONY: regen_files
30 endif