Skip to content

Commit

Permalink
Generate man page from README.md using pandoc
Browse files Browse the repository at this point in the history
  • Loading branch information
im-0 committed Dec 12, 2018
1 parent 6c0e1bf commit e7d8eec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.o
hpsahba
hpsahba.8
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ os:

dist: xenial

# To install additional packages.
sudo: required

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y pandoc

script:
- make all
- make clean
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
.SUFFIXES: .c .o

CC = gcc
PANDOC = pandoc

BASE_CFLAGS = -std=gnu99 -Wall -Wextra
CFLAGS = -O2 -g
BASE_LDFLAGS =
LDFLAGS =


all: hpsahba
all: hpsahba hpsahba.8

.c.o:
$(CC) $(BASE_CFLAGS) $(CFLAGS) -c -o $(@) $(<)
Expand All @@ -19,7 +20,11 @@ main.o: hpsa.h
hpsahba: main.o
$(CC) $(BASE_CFLAGS) $(CFLAGS) $(BASE_LDFLAGS) $(LDFLAGS) -o $(@) $(<)

hpsahba.8: README.md
$(PANDOC) --from markdown --to man --standalone --metadata "title=HPSAHBA(8)" --output $(@) $(<)

clean:
rm -f *.o
rm -f hpsahba
rm -f hpsahba.8

0 comments on commit e7d8eec

Please sign in to comment.