Skip to content

Commit e370fdf

Browse files
committed
Makefile: Use xz archive format when building on Linux
1 parent a1f944a commit e370fdf

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ DISTFILES= \
6868
CLEANFILES= \
6969
output
7070

71+
TAR_FORMAT := gz
72+
TAR_OPTION := z
73+
UNAME_S := $(shell uname -s)
74+
ifeq ($(UNAME_S),Linux)
75+
TAR_FORMAT := xz
76+
TAR_OPTION := J
77+
endif
78+
7179
clean:
7280
rm -rf $(CLEANFILES)
7381

@@ -76,7 +84,7 @@ check:
7684
dist: clean
7785
mkdir -p "cppreference-doc-$(VERSION)"
7886
cp -r $(DISTFILES) "cppreference-doc-$(VERSION)"
79-
tar czf "cppreference-doc-$(VERSION).tar.gz" "cppreference-doc-$(VERSION)"
87+
tar c$(TAR_OPTION)f "cppreference-doc-$(VERSION).tar.$(TAR_FORMAT)" "cppreference-doc-$(VERSION)"
8088
rm -rf "cppreference-doc-$(VERSION)"
8189

8290
install: all
@@ -110,21 +118,21 @@ release: all
110118
# zip the distributable
111119
mkdir -p "cppreference-doc-$(VERSION)"
112120
cp -r $(DISTFILES) "cppreference-doc-$(VERSION)"
113-
tar czf "release/cppreference-doc-$(VERSION).tar.gz" "cppreference-doc-$(VERSION)"
121+
tar c$(TAR_OPTION)f "release/cppreference-doc-$(VERSION).tar.$(TAR_FORMAT)" "cppreference-doc-$(VERSION)"
114122
zip -r "release/cppreference-doc-$(VERSION).zip" "cppreference-doc-$(VERSION)"
115123
rm -rf "cppreference-doc-$(VERSION)"
116124

117125
# zip the html output
118126
pushd "output"; \
119-
tar czf "../release/html-book-$(VERSION).tar.gz" "reference" \
127+
tar c$(TAR_OPTION)f "../release/html-book-$(VERSION).tar.$(TAR_FORMAT)" "reference" \
120128
"cppreference-doxygen-local.tag.xml" ; \
121129
zip -r "../release/html-book-$(VERSION).zip" "reference" \
122130
"cppreference-doxygen-local.tag.xml" ; \
123131
popd
124132

125133
# zip qch
126134
pushd "output"; \
127-
tar czf "../release/qch-book-$(VERSION).tar.gz" "cppreference-doc-en-cpp.qch"; \
135+
tar c$(TAR_OPTION)f "../release/qch-book-$(VERSION).tar.$(TAR_FORMAT)" "cppreference-doc-en-cpp.qch"; \
128136
zip -r "../release/qch-book-$(VERSION).zip" "cppreference-doc-en-cpp.qch"; \
129137
popd
130138

0 commit comments

Comments
 (0)