Add pkg-config file, scdoc -v

master
Drew DeVault 6 years ago
parent 18ea282526
commit 309ff4672b
  1. 2
      Makefile
  2. 0
      include/str.h
  3. 7
      scdoc.pc
  4. 8
      src/main.c
  5. 2
      src/string.c

@ -6,6 +6,7 @@ PREFIX?=/usr/local
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR?=$(_INSTDIR)/bin
MANDIR?=$(_INSTDIR)/share/man
PCDIR?=$(_INSTDIR)/lib/pkgconfig
OUTDIR=.build
HOST_SCDOC=./scdoc
.DEFAULT_GOAL=all
@ -43,6 +44,7 @@ install: all
install -Dm755 scdoc $(BINDIR)/scdoc
install -Dm644 scdoc.1 $(MANDIR)/man1/scdoc.1
install -Dm644 scdoc.5 $(MANDIR)/man5/scdoc.5
install -Dm644 scdoc.pc $(PCDIR)/scdoc.pc
check: scdoc scdoc.1 scdoc.5
@find test -perm -111 -exec '{}' \;

@ -0,0 +1,7 @@
prefix=/usr
exec_prefix=${prefix}
scdoc=${exec_prefix}/bin/scdoc
Name: scdoc
Description: Man page generator
Version: 1.8.1

@ -6,9 +6,10 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "string.h"
#include "str.h"
#include "unicode.h"
#include "util.h"
@ -686,7 +687,10 @@ static void output_scdoc_preamble(struct parser *p) {
}
int main(int argc, char **argv) {
if (argc > 1) {
if (argc == 2 && strcmp(argv[1], "-v") == 0) {
printf("scdoc " VERSION "\n");
return 0;
} else if (argc > 1) {
fprintf(stderr, "Usage: scdoc < input.scd > output.roff\n");
return 1;
}

@ -1,6 +1,6 @@
#include <stdlib.h>
#include <stdint.h>
#include "string.h"
#include "str.h"
#include "unicode.h"
static int ensure_capacity(str_t *str, size_t len) {

Loading…
Cancel
Save