Add OUTDIR to Makefile

master
Drew DeVault 7 years ago
parent 2f38d508d6
commit a1bf6922c8
  1. 27
      Makefile

@ -7,21 +7,22 @@ DESTDIR=
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR=$(_INSTDIR)/bin
MANDIR=$(_INSTDIR)/share/man
OUTDIR=.build
.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
$(OUTDIR)/main.o \
$(OUTDIR)/string.o \
$(OUTDIR)/utf8_chsize.o \
$(OUTDIR)/utf8_decode.o \
$(OUTDIR)/utf8_encode.o \
$(OUTDIR)/utf8_fgetch.o \
$(OUTDIR)/utf8_fputch.o \
$(OUTDIR)/utf8_size.o \
$(OUTDIR)/util.o
$(OUTDIR)/%.o: src/%.c
@mkdir -p $(OUTDIR)
$(CC) -std=c99 -pedantic -c -o $@ $(CFLAGS) $(INCLUDE) $<
scdoc: $(OBJECTS)
@ -33,7 +34,7 @@ scdoc.1: scdoc.1.scd scdoc
all: scdoc scdoc.1
clean:
rm -rf .build scdoc
rm -rf $(OUTDIR) scdoc
install: all
install -Dm755 scdoc $(BINDIR)/scdoc

Loading…
Cancel
Save