Skip to content

Commit

Permalink
Merge pull request #4036 from masatake/msvc--generate-peg-related-bui…
Browse files Browse the repository at this point in the history
…ld-rules

build-sys,mvc: generate rules for running packcc from source.mak
  • Loading branch information
masatake authored Jul 29, 2024
2 parents eb42eec + ec77db4 commit 29b9e6f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
msystem: ${{ matrix.msystem }}
update: true
install: automake autoconf make dos2unix
pacboy: toolchain:p python3-sphinx:p jansson:p libxml2:p libyaml:p pcre2:p
pacboy: toolchain:p python-sphinx:p jansson:p libxml2:p libyaml:p pcre2:p

- run: git config --global core.autocrlf input
shell: bash
Expand Down
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
5 changes: 1 addition & 4 deletions mk_mvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ $(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)
include win32/peg_rule.mak

$(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 29b9e6f

Please sign in to comment.