Skip to content

Commit 9c85efd

Browse files
committed
ripper: Add VPATH for nmake
1 parent 2524518 commit 9c85efd

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

ext/ripper/depend

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ SRC1 = $(top_srcdir)/parse.y
33
SRC2 = $(srcdir)/eventids2.c
44
LRAMA = $(BASERUBY) $(top_srcdir)/tool/lrama/exe/lrama
55

6-
generated_srcs = ripper.c ripper_init.c eventids1.c eventids1.h eventids2table.c
6+
generated_srcs = {$(VPATH)}ripper.c {$(VPATH)}ripper_init.c \
7+
{$(VPATH)}eventids1.c {$(VPATH)}eventids1.h {$(VPATH)}eventids2table.c
78

89
.SUFFIXES: .y
910

@@ -27,16 +28,15 @@ realclean-srcs: distclean-srcs
2728

2829
.PHONY: clean-srcs clean--srcs clean-$(srcdir)-srcs distclean-srcs realclean-srcs
2930

30-
ripper.o: ripper.c
31-
32-
.y.c:
31+
{$(VPATH)}.y{$(VPATH)}.c:
3332
$(ECHO) compiling compiler $<
3433
$(Q) $(LRAMA) -o$@ - $< < $<
3534

3635
all: check
3736
static: check
3837

39-
ripper.y: $(srcdir)/tools/preproc.rb $(srcdir)/tools/dsl.rb $(top_srcdir)/parse.y $(top_srcdir)/defs/id.def
38+
{$(VPATH)}ripper.y: $(srcdir)/tools/preproc.rb $(srcdir)/tools/dsl.rb \
39+
$(SRC1) $(top_srcdir)/defs/id.def
4040
$(ECHO) extracting $@ from $(top_srcdir)/parse.y
4141
$(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb $(top_srcdir)/parse.y | \
4242
$(RUBY) $(srcdir)/tools/preproc.rb --output=$@ - ripper.y
@@ -48,27 +48,29 @@ check: .eventids2-check
4848
$(Q) $(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
4949
@exit > $@
5050

51-
eventids1.h: $(GEN) $(srcdir)/tools/dsl.rb $(SRC1)
51+
{$(VPATH)}eventids1.h: $(GEN) $(srcdir)/tools/dsl.rb $(SRC1)
5252
$(ECHO) generating $@ from $(SRC1)
5353
$(Q) $(RUBY) $(GEN) --mode=eventids1_h --ids1src=$(SRC1) --output=$@
5454

55-
eventids1.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC1)
55+
{$(VPATH)}eventids1.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC1)
5656
$(ECHO) generating $@ from $(SRC1)
5757
$(Q) $(RUBY) $(GEN) --mode=eventids1 --ids1src=$(SRC1) --output=$@
5858

59-
eventids2table.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC2)
59+
{$(VPATH)}eventids2table.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC2)
6060
$(ECHO) generating $@ from $(SRC2)
6161
$(Q) $(RUBY) $(GEN) --mode=eventids2table --ids2src=$(SRC2) --output=$@
6262

63-
ripper_init.c: $(srcdir)/ripper_init.c.tmpl ripper.y $(srcdir)/tools/preproc.rb $(top_srcdir)/internal/ruby_parser.h
63+
{$(VPATH)}ripper_init.c: $(srcdir)/ripper_init.c.tmpl ripper.y \
64+
$(srcdir)/tools/preproc.rb $(top_srcdir)/internal/ruby_parser.h
6465
$(ECHO) generating $@ from $(srcdir)/ripper_init.c.tmpl
6566
$(Q) $(RUBY) $(srcdir)/tools/preproc.rb --output=$@ --template=$(srcdir)/ripper_init.c.tmpl $(top_srcdir)/internal/ruby_parser.h
6667

6768
# Entries for Ripper maintainer
6869

6970
preproc: ripper.E
7071
ripper.E: ripper.c
71-
$(ECHO) preprocessing ripper.c
72+
{$(VPATH)}.c.E:
73+
$(ECHO) preprocessing $<
7274
$(Q) $(CC) -E $(INCFLAGS) $(CPPFLAGS) $< | $(RUBY) $(srcdir)/tools/strip.rb > $@
7375

7476
# AUTOGENERATED DEPENDENCIES START

0 commit comments

Comments
 (0)