aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-03-30 15:41:44 -0400
committerCameron Katri <me@cameronkatri.com>2021-03-30 17:16:03 -0400
commita9bda63998e2f358b07a50a8dd4ed48100f9a9ee (patch)
tree3b2273f3e69ca3b4f651805987ce481245a875a2 /Makefile
parentabc920dfbe0fc390c02b1e23f64092c11726174d (diff)
downloadbsd-progress-a9bda63998e2f358b07a50a8dd4ed48100f9a9ee.tar.gz
bsd-progress-a9bda63998e2f358b07a50a8dd4ed48100f9a9ee.tar.zst
bsd-progress-a9bda63998e2f358b07a50a8dd4ed48100f9a9ee.zip
progress: Port for Linux and DarwinHEADtrunk
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 25 insertions, 6 deletions
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 <bsd.own.mk>
-
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 <bsd.prog.mk>
+.PHONY: all install clean