Skip to content

Commit

Permalink
build-sys,mvc: generate rules for running packcc from source.mak
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed Jul 29, 2024
1 parent eb42eec commit 2ab6cd9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion makefiles/testing.mak
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ if HAVE_RST2MAN
endif
endif

# win32/ctags_vs2013.vcxproj* : committed for win32 build without POSIX tools
# win32/{ctags_vs2013.vcxproj*,peg_rule.mak} : committed for win32 build without POSIX tools
# regenerate files w/o out-of-source build and w/ GNU make
.PHONY: cg-force-win32 check-genfile-win32
cg-force-win32:
Expand Down
6 changes: 1 addition & 5 deletions mk_mvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

OBJEXT = obj
include source.mak
include win32/peg_rule.mak

COMMON_DEFINES =
DEFINES = $(COMMON_DEFINES) -DHAVE_REPOINFO_H -DHAVE_PACKCC -DREADTAGS_DSL
Expand Down Expand Up @@ -102,11 +103,6 @@ $(PACKCC): $(PACKCC_OBJ)

main\repoinfo.obj: main\repoinfo.c main\repoinfo.h

peg\varlink.c peg\varlink.h: peg\varlink.peg $(PACKCC)
peg\kotlin.c peg\kotlin.h: peg\kotlin.peg $(PACKCC)
peg\thrift.c peg\thrift.h: peg\thrift.peg $(PACKCC)
peg\elm.c peg\elm.h: peg\elm.peg $(PACKCC)

$(RES_OBJ): win32/ctags.rc win32/ctags.exe.manifest win32/resource.h
$(RC) /nologo /l 0x409 /Fo$@ $*.rc

Expand Down
13 changes: 11 additions & 2 deletions win32/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is released for free distribution under the terms of the
# GNU General Public License version 2 or (at your option) any later version.
#
# Makefile to generate ctags_vs2013.vcxproj and ctags_vs2013.vcxproj.filters
# Makefile to generate ctags_vs2013.vcxproj, ctags_vs2013.vcxproj.filters and peg_rule.mak
#
# usage: make [-B]
#
Expand All @@ -18,8 +18,9 @@
VCXPROJ = ctags_vs2013.vcxproj
VCXPROJ_FILTERS = ctags_vs2013.vcxproj.filters
SOURCE_MAK = ../source.mak
PEG_RULE_MAK = peg_rule.mak

all: $(VCXPROJ) $(VCXPROJ_FILTERS)
all: $(VCXPROJ) $(VCXPROJ_FILTERS) $(PEG_RULE_MAK)

include $(SOURCE_MAK)

Expand Down Expand Up @@ -83,3 +84,11 @@ $(VCXPROJ_FILTERS): $(VCXPROJ_FILTERS).in $(SOURCE_MAK)
# replace @foo@ in $(VCXPROJ_FILTERS).in \
sed -e "s![@]SRCS[@]!$$SRCS!" \
-e "s![@]HEADS[@]!$$HEADS!" $< | $(LF2CRLF) > $@

$(PEG_RULE_MAK): $(SOURCE_MAK)
@echo generating $@ ...
@# PEG source files \
$(ECHO) '# Generated by win32/GNUmakefile' > $@; \
for i in $(PEG_INPUT); do \
$(ECHO) "peg/$$(basename $$i .peg).c peg/$$(basename $$i .peg).h: $$i \$$(PACKCC)"; \
done >> $@
5 changes: 5 additions & 0 deletions win32/peg_rule.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generated by win32/GNUmakefile
peg/varlink.c peg/varlink.h: peg/varlink.peg $(PACKCC)
peg/kotlin.c peg/kotlin.h: peg/kotlin.peg $(PACKCC)
peg/thrift.c peg/thrift.h: peg/thrift.peg $(PACKCC)
peg/elm.c peg/elm.h: peg/elm.peg $(PACKCC)

0 comments on commit 2ab6cd9

Please sign in to comment.