Skip to content

Commit

Permalink
makefile: make doc completed
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick330602 committed Jan 26, 2020
1 parent d166e95 commit ff704b2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ MANFILES := $(wildcard docs/*)
INSTEDEXES := $(wildcard /usr/bin/wsl*)
INSTEDMANS := $(wildcard /usr/share/man/man1/wsl*)

DATETMP = $(shell date +%Y-%m-%d)
VERTMP = $(shell grep 'version=' $(HEADER) | cut -d'=' -f 2 | xargs)

all:
[ -d $(OUTPATH) ] || mkdir $(OUTPATH)
for file in $(SOURCES); do \
cat $(HEADER) $$file > $(OUTPATH)/`basename $$file`; \
mv $(OUTPATH)/`basename $$file` $(OUTPATH)/`basename $$file .sh`; \
done
chmod +x $(OUTPFILES)
chmod +x $(OUTPATH)/*

install:
install -Dm 555 docs-out/* -t $(DESTDIR)/share/man/man1
Expand All @@ -38,14 +41,14 @@ doc:
[ -d $(OUTMANPATH) ] || mkdir $(OUTMANPATH)
for file in $(MANFILES); do \
cp $$file $(OUTMANPATH); \
sed -i 's|DATEPLACEHOLDER|''$(date +%Y-%m-%d)''|' $(OUTMANPATH)/`basename $$file`; \
sed -i 's|VERSIONPLACEHOLDER|''$(grep 'version=' $(HEADER) | cut -d'=' -f 2 | xargs)''|' $(OUTMANPATH)/`basename $$file`; \
gzip $(OUTMANPATH)/`basename $$file`; \
rm $(OUTMANPATH)/`basename $$file`; \
sed -e 's/DATEPLACEHOLDER/'$(DATETMP)'/' -e 's/VERSIONPLACEHOLDER/'$(VERTMP)'/' $(OUTMANPATH)/`basename $$file` > $(OUTMANPATH)/`basename $$file`.tmp; \
mv $(OUTMANPATH)/`basename $$file`.tmp $(OUTMANPATH)/`basename $$file`; \
gzip -f -q $(OUTMANPATH)/`basename $$file`; \
done

clean:
rm -rf $(OUTPATH)
rm -rf $(OUTMANPATH)

test:
extras/bats/libexec/bats tests/header.bats tests/wslsys.bats tests/wslusc.bats tests/wslupath.bats tests/wslvar.bats tests/wslfetch.bats tests/wslview.bats

0 comments on commit ff704b2

Please sign in to comment.