Skip to content

Commit b24bacc

Browse files
committed
fix: handle paths containing spaces in Makefiles
1 parent 1cec84e commit b24bacc

19 files changed

Lines changed: 591 additions & 74 deletions

File tree

‎.github/FUNDING.yml‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.github/workflows/check.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: checkout repository
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@v7
2424
- name: install dependencies
2525
run: sudo apt install -y lcov astyle
2626
- name: set RELEASE number
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: checkout repository
40-
uses: actions/checkout@v6
40+
uses: actions/checkout@v7
4141
- name: setup go build environment
4242
uses: actions/setup-go@v6
4343
with:
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
steps:
5454
- name: checkout repository
55-
uses: actions/checkout@v6
55+
uses: actions/checkout@v7
5656
- name: setup node build environment
5757
uses: actions/setup-node@v6
5858
with:
@@ -68,7 +68,7 @@ jobs:
6868
runs-on: ubuntu-latest
6969
steps:
7070
- name: checkout repository
71-
uses: actions/checkout@v6
71+
uses: actions/checkout@v7
7272
- name: setup python build environment
7373
uses: actions/setup-python@v6
7474
with:
@@ -86,7 +86,7 @@ jobs:
8686
runs-on: ubuntu-latest
8787
steps:
8888
- name: checkout repository
89-
uses: actions/checkout@v6
89+
uses: actions/checkout@v7
9090
- name: setup python build environment
9191
uses: actions/setup-python@v6
9292
with:
@@ -104,7 +104,7 @@ jobs:
104104
runs-on: ubuntu-latest
105105
steps:
106106
- name: checkout repository
107-
uses: actions/checkout@v6
107+
uses: actions/checkout@v7
108108
- name: setup R build environment
109109
uses: r-lib/actions/setup-r@v2
110110
- name: Install dependencies

‎.github/workflows/codeql.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@v6
63+
uses: actions/checkout@v7
6464

6565
# Initializes the CodeQL tools for scanning.
6666
- name: Initialize CodeQL

‎.github/workflows/dependency-review.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@v6
18+
uses: actions/checkout@v7
1919
- name: 'Dependency Review'
2020
uses: actions/dependency-review-action@v4

‎Makefile‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ VERSION=$(shell cat VERSION)
2929
RELEASE=$(shell cat RELEASE)
3030

3131
# Current directory
32-
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
32+
CURRENTDIR=$(CURDIR)/
3333

3434
# Target directory
35-
TARGETDIR=$(CURRENTDIR)target
35+
TARGETDIR=target
3636

3737
# Docker command
3838
ifeq ($(DOCKER),)
@@ -97,16 +97,16 @@ clean:
9797
## Build everything inside a Docker container
9898
.PHONY: dbuild
9999
dbuild: dockerdev
100-
@mkdir -p $(TARGETDIR)
101-
@rm -rf $(TARGETDIR)/*
102-
@echo 0 > $(TARGETDIR)/make.exit
103-
CVSPATH=$(CVSPATH) VENDOR=$(LCVENDOR) PROJECT=$(PROJECT) MAKETARGET='$(MAKETARGET)' $(CURRENTDIR)dockerbuild.sh
100+
@mkdir -p "$(TARGETDIR)"
101+
@rm -rf "$(TARGETDIR)/"*
102+
@echo 0 > "$(TARGETDIR)/make.exit"
103+
CVSPATH=$(CVSPATH) VENDOR=$(LCVENDOR) PROJECT=$(PROJECT) MAKETARGET='$(MAKETARGET)' "$(CURRENTDIR)dockerbuild.sh"
104104
@exit `cat $(TARGETDIR)/make.exit`
105105

106106
## Build a base development Docker image
107107
.PHONY: dockerdev
108108
dockerdev:
109-
$(DOCKER) build --pull --tag ${LCVENDOR}/dev_${PROJECT} --file ./resources/docker/Dockerfile.dev ./resources/docker/
109+
$(DOCKER) build --pull --tag "${LCVENDOR}/dev_${PROJECT}" --file ./resources/docker/Dockerfile.dev ./resources/docker/
110110

111111
## Publish Documentation in GitHub (requires writing permissions)
112112
.PHONY: pubdocs

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.7.29
1+
5.7.30

‎c/Makefile‎

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ VERSION=$(shell cat ../VERSION)
2626
RELEASE=$(shell cat ../RELEASE)
2727

2828
# Current directory
29-
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
29+
CURRENTDIR=$(CURDIR)/
3030

3131
# Name of RPM or DEB package
3232
PKGNAME=${VENDOR}-${PROJECT}-headers
@@ -158,26 +158,27 @@ clean:
158158
## Install this application
159159
.PHONY: install
160160
install: uninstall
161-
mkdir -p $(PATHINSTLIB)
162-
cp src/variantkey/*.h $(PATHINSTLIB)
163-
find $(PATHINSTLIB) -type f -exec chmod 644 {} \;
164-
mkdir -p $(PATHINSTDOC)
165-
cp -f ../LICENSE $(PATHINSTDOC)
166-
cp -f ../README.md $(PATHINSTDOC)
167-
cp -f ../VERSION $(PATHINSTDOC)
168-
cp -f ../RELEASE $(PATHINSTDOC)
169-
chmod -R 644 $(PATHINSTDOC)*
161+
mkdir -p "$(PATHINSTLIB)"
162+
cp src/variantkey/*.h "$(PATHINSTLIB)"
163+
find "$(PATHINSTLIB)" -type f -exec chmod 644 {} \;
164+
mkdir -p "$(PATHINSTDOC)"
165+
cp -f ../LICENSE "$(PATHINSTDOC)"
166+
cp -f ../README.md "$(PATHINSTDOC)"
167+
cp -f ../VERSION "$(PATHINSTDOC)"
168+
cp -f ../RELEASE "$(PATHINSTDOC)"
169+
chmod -R 644 "$(PATHINSTDOC)"*
170170

171171
## Remove all installed files (excluding configuration files)
172172
.PHONY: uninstall
173173
uninstall:
174-
rm -rf $(PATHINSTLIB)
175-
rm -rf $(PATHINSTDOC)
174+
rm -rf "$(PATHINSTLIB)"
175+
rm -rf "$(PATHINSTDOC)"
176176

177177
## Build the RPM package for RedHat-like Linux distributions
178178
.PHONY: rpm
179179
rpm:
180-
rm -rf $(PATHRPMPKG)
180+
@test $(words $(CURDIR)) -eq 1 || { echo "ERROR: rpmbuild does not support spaces in the project path: $(CURDIR)"; exit 1; }
181+
rm -rf "$(PATHRPMPKG)"
181182
rpmbuild \
182183
--define "_topdir $(PATHRPMPKG)" \
183184
--define "_vendor $(VENDOR)" \
@@ -194,18 +195,18 @@ rpm:
194195
## Build the DEB package for Debian-like Linux distributions
195196
.PHONY: deb
196197
deb:
197-
rm -rf $(PATHDEBPKG)
198-
make install DESTDIR=$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)
199-
rm -f $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(DOCPATH)LICENSE
200-
tar -zcvf $(PATHDEBPKG)/$(PKGNAME)_$(VERSION).orig.tar.gz -C $(PATHDEBPKG)/ $(PKGNAME)-$(VERSION)
201-
cp -rf ./resources/debian $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian
202-
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed $(SEDINPLACE) "s/~#DATE#~/`date -R`/" {} \;
203-
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed $(SEDINPLACE) "s/~#PKGNAME#~/$(PKGNAME)/" {} \;
204-
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed $(SEDINPLACE) "s/~#VERSION#~/$(VERSION)/" {} \;
205-
find $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/ -type f -exec sed $(SEDINPLACE) "s/~#RELEASE#~/$(RELEASE)/" {} \;
206-
echo $(LIBPATH) > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs
207-
echo "$(LIBPATH)* $(LIBPATH)" > $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install
208-
echo $(DOCPATH) >> $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs
209-
echo "$(DOCPATH)* $(DOCPATH)" >> $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install
210-
echo "new-package-should-close-itp-bug" >> $(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).lintian-overrides
211-
cd $(PATHDEBPKG)/$(PKGNAME)-$(VERSION) && debuild -us -uc
198+
rm -rf "$(PATHDEBPKG)"
199+
make install DESTDIR="$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)"
200+
rm -f "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/$(DOCPATH)LICENSE"
201+
tar -zcvf "$(PATHDEBPKG)/$(PKGNAME)_$(VERSION).orig.tar.gz" -C "$(PATHDEBPKG)/" "$(PKGNAME)-$(VERSION)"
202+
cp -rf ./resources/debian "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian"
203+
find "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/" -type f -exec sed $(SEDINPLACE) "s/~#DATE#~/`date -R`/" {} \;
204+
find "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/" -type f -exec sed $(SEDINPLACE) "s/~#PKGNAME#~/$(PKGNAME)/" {} \;
205+
find "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/" -type f -exec sed $(SEDINPLACE) "s/~#VERSION#~/$(VERSION)/" {} \;
206+
find "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/" -type f -exec sed $(SEDINPLACE) "s/~#RELEASE#~/$(RELEASE)/" {} \;
207+
echo "$(LIBPATH)" > "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs"
208+
echo "$(LIBPATH)* $(LIBPATH)" > "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install"
209+
echo "$(DOCPATH)" >> "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).dirs"
210+
echo "$(DOCPATH)* $(DOCPATH)" >> "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/install"
211+
echo "new-package-should-close-itp-bug" >> "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)/debian/$(PKGNAME).lintian-overrides"
212+
cd "$(PATHDEBPKG)/$(PKGNAME)-$(VERSION)" && debuild -us -uc

‎c/doc/Doxyfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PROJECT_NAME = "VariantKey"
3232
# This could be handy for archiving the generated documentation or
3333
# if some version control system is used.
3434

35-
PROJECT_NUMBER = 5.7.29
35+
PROJECT_NUMBER = 5.7.30
3636

3737
# Using the PROJECT_BRIEF tag one can provide an optional one line description
3838
# for a project that appears at the top of each page and should give viewer

‎c/resources/rpm/rpm.spec‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ESID, a reversible numerical encoding schema for genetic string identifiers.
2828
#(cd %{_current_directory} && make build)
2929

3030
%install
31-
rm -rf $RPM_BUILD_ROOT
32-
(cd %{_current_directory} && make install DESTDIR=$RPM_BUILD_ROOT)
31+
rm -rf "$RPM_BUILD_ROOT"
32+
(cd "%{_current_directory}" && make install DESTDIR="$RPM_BUILD_ROOT")
3333

3434
#%clean
3535
#rm -rf $RPM_BUILD_ROOT

‎c/test/rsidvar_bench/CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_BINARY_DIR}/src/varian
99
file(COPY DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
1010
add_executable(rsidvar_bench rsidvar_bench.c)
1111
target_link_libraries(rsidvar_bench variantkey)
12+
13+
add_executable(vk_csv_lookup_bench vk_csv_lookup_bench.c)
14+
target_link_libraries(vk_csv_lookup_bench variantkey)

0 commit comments

Comments
 (0)