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

Loading…
Cancel
Save