From a9bda63998e2f358b07a50a8dd4ed48100f9a9ee Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Tue, 30 Mar 2021 15:41:44 -0400 Subject: progress: Port for Linux and Darwin --- Makefile | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5bcdedf..cc9c47d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,31 @@ # $NetBSD: Makefile,v 1.2 2003/01/22 02:56:30 lukem Exp $ -.include - PROG= progress -SRCS= progress.c progressbar.c +SRCS= progress.c progressbar.c strsuftoll.c + + +CPPFLAGS +=-Iinclude -DSTANDALONE_PROGRESS +UNAME ?= $(shell uname) +PREFIX ?= /usr +PROG_PREFIX ?= bsd- + +ifeq ($(UNAME), Linux) +ifeq ($(shell pkg-config libbsd-overlay && echo 1),1) + CPPFLAGS+=$(shell pkg-config libbsd-overlay --cflags) + LDFLAGS+=$(shell pkg-config libbsd-overlay --libs) +endif # ($(shell pkg-config libbsd-overlay && echo 1),1) +endif # ($(UNAME), Linux) + +all: $(PROG) + +$(PROG): $(SRCS:%.c=%.o) + $(CC) $(LDFLAGS) -o $@ $^ -CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/ftp -DSTANDALONE_PROGRESS +install: $(PROG) progress.1 + install -Dm755 $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG_PREFIX)$(PROG) + install -Dm644 progress.1 $(DESTDIR)$(PREFIX)/share/man/man1/$(PROG_PREFIX)progress.1 -.PATH: ${NETBSDSRCDIR}/usr.bin/ftp +clean: + rm -f *.o $(PROG) -.include +.PHONY: all install clean -- cgit v1.2.3-56-ge451