You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scdoc/Makefile

44 lines
802 B

CC=cc
CFLAGS=-Wall -Wextra -Werror -Wno-unused-parameter
LDFLAGS=-static
INCLUDE=-Iinclude
PREFIX=/usr/local
DESTDIR=
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR=$(_INSTDIR)/bin
MANDIR=$(_INSTDIR)/share/man
.DEFAULT_GOAL=all
OBJECTS=\
.build/main.o \
.build/string.o \
.build/utf8_chsize.o \
.build/utf8_decode.o \
.build/utf8_encode.o \
.build/utf8_fgetch.o \
.build/utf8_fputch.o \
.build/utf8_size.o \
.build/util.o
.build/%.o: src/%.c
@mkdir -p .build
$(CC) -std=c99 -c -o $@ $(CFLAGS) $(INCLUDE) $<
scdoc: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^
scdoc.1: scdoc.1.scd scdoc
./scdoc < $< > $@
all: scdoc scdoc.1
clean:
rm -rf .build scdoc
install: all
mkdir -p $(DESTDIR)
install -Dm755 scdoc $(BINDIR)/scdoc
install -Dm644 scdoc.1 $(MANDIR)/scdoc.1
.PHONY: all clean install