aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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