prout

smaller "lp" command
git clone git://git.2f30.org/prout.git
Log | Files | Refs | README | LICENSE

commit f851bb0901d8084ae7eb2ef43af64b93d633c17c
parent 29e9c5ae17148c2569f3a5c7119157df2819a17d
Author: z3bra <willy@mailoo.org>
Date:   Mon, 10 Feb 2014 10:08:19 +0100

More sane Makefile

Diffstat:
MMakefile | 72++++++++++++++++++------------------------------------------------------
Rman/prout.1.gz -> prout.1.gz | 0
Rsrc/prout.c -> prout.c | 0
3 files changed, 18 insertions(+), 54 deletions(-)

diff --git a/Makefile b/Makefile @@ -9,71 +9,35 @@ LDFLAGS+=`cups-config --libs` # Command paths RM=/bin/rm -# Directories -SRCDIR=src -INCDIR=inc -OBJDIR=obj -BINDIR=bin -ETCDIR=etc -QOTDIR=dat -MANDIR=man PREFIX:=/usr -MANPREFIX:=$(PREFIX)/share/man +MANPREFIX:=${PREFIX}/share/man -# Filetype paths -vpath %.c $(SRCDIR) -vpath %.h $(INCDIR) +.SUFFIXES: +.SUFFIXES: .c .h .o +.PHONY : all clean init install uninstall -# Files -SRC:=$(wildcard $(SRCDIR)/*.c) -OBJ:=$(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC)) -INC:=$(wildcard $(INCDIR)/*.h) -QOT:=$(wildcard $(QOTDIR)/*.qot) -ETC:=$(ETCDIR)/$(PROG).conf -BIN:=$(BINDIR)/$(PROG) - -.PHONY : all echo mrproper clean init install uninstall - -$(BIN) : $(OBJ) - @if [[ ! -d $(BINDIR) ]]; then mkdir $(BINDIR); fi - @echo -e "LD $(PROG)" - @$(CC) $^ -o $@ $(LDFLAGS) - -$(OBJDIR)/%.o : $(SRCDIR)/%.c - @if [[ ! -d $(OBJDIR) ]]; then mkdir $(OBJDIR); fi +.c.o: @echo -e "CC $<" - @$(CC) -c $(CFLAGS) $< -o $@ + @${CC} -c ${CFLAGS} $< -o $@ -all : init $(BIN) $(INC) +prout: prout.o + @echo -e "LD prout" + @${CC} $^ -o $@ ${LDFLAGS} -list : - @echo "SOURCES : $(SRC)" - @echo "OBJECTS : $(OBJ)" - @echo "INCLUDE : $(INC)" - @echo "BINARY : $(BIN)" - -mrproper : clean - $(RM) $(BIN) +all : prout clean : - $(RM) -f $(OBJDIR)/*.o - $(RM) -f *~ - -init : - @echo "CC = $(CC)" - @echo "CFLAGS = $(CFLAGS)" - @echo "LDFLAGS = $(LDFLAGS)" - @echo + ${RM} -f prout + ${RM} -f *.o + ${RM} -f *~ -install: $(BIN) - install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/$(PROG) $(DESTDIR)$(MANPREFIX)/man1 - install -m 755 bin/$(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG) - install -m 644 $(MANDIR)/$(PROG).1.gz $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1.gz +install: ${BIN} + install -D -m 0755 bin/prout ${DESTDIR}${PREFIX}/bin/prout + install -D -m 0644 ${MANDIR}/prout.1.gz ${DESTDIR}${MANPREFIX}/man1/prout.1.gz uninstall: - $(RM) $(DESTDIR)$(PREFIX)/bin/$(PROG) - $(RM) -r $(DESTDIR)$(PREFIX)/share/$(PROG) - $(RM) $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1.gz + ${RM} ${DESTDIR}${PREFIX}/bin/prout + ${RM} ${DESTDIR}${MANPREFIX}/man1/prout.1.gz ## EOF diff --git a/man/prout.1.gz b/prout.1.gz Binary files differ. diff --git a/src/prout.c b/prout.c