shithub: tlsclient

Download patch

ref: 673bb2f19f13a189a9cc8924ebe3c06b56c4cc3b
parent: 486f9888ba84132c7705607ded55f55ddd451a6c
author: Jacob Moody <moody@posixcafe.org>
date: Tue Jul 5 21:43:55 EDT 2022

clean makefile

--- a/.builds/obsd.yml
+++ b/.builds/obsd.yml
@@ -4,10 +4,8 @@
 packages:
   - "openssl-1.1.1k"
 artifacts:
-  - tlsclient/tlsclient-obsd.tar.gz
+  - tlsclient/obsd.tar.gz
 tasks:
   - build: |
       cd tlsclient
-      sed -i '/^OPENSSL/d' Make.config
-      sed -i 's/#OPENSSL/OPENSSL/g' Make.config
-      make -j $(sysctl -n hw.ncpu) obsddist
+      OPENSSL=eopenssl11 make -j $(sysctl -n hw.ncpu) obsd.tar.gz
--- a/.builds/pam.yml
+++ b/.builds/pam.yml
@@ -2,8 +2,8 @@
 sources:
   - https://git.sr.ht/~moody/tlsclient
 artifacts:
-  - tlsclient/tlsclient.tar.gz
+  - tlsclient/linux.tar.gz
 tasks:
   - build: | 
       cd tlsclient
-      make -j $(nproc) linuxdist
+      make -j $(nproc) linux.tar.gz
--- a/Make.config
+++ b/Make.config
@@ -2,11 +2,7 @@
 RANLIB=ranlib
 CFLAGS=-Wno-deprecated-declarations -Wall -Wno-missing-braces -Wno-parentheses -ggdb -I$(ROOT) -I$(ROOT)/include -c -D_THREAD_SAFE -O2 -fPIC
 O=o
-LDADD=
-TARG=tlsclient
+PREFIX ?= /usr
 
-# For OpenBSD switch these two following lines
-OPENSSL=openssl
-#OPENSSL=eopenssl11
-
-all: default
+# For OpenBSD use 'eopenssl11'
+OPENSSL ?= openssl
--- a/Makefile
+++ b/Makefile
@@ -3,59 +3,49 @@
 include ./Make.config
 
 LIBS=\
+	p9any.$O\
 	libauthsrv/libauthsrv.a\
 	libmp/libmp.a\
 	libc/libc.a\
 	libsec/libsec.a\
 
-OFILES=cpu.$O p9any.$O
+default: tlsclient
 
-default: $(TARG)
-$(TARG): $(LIBS) $(OFILES)
-	$(CC) `pkg-config $(OPENSSL) --libs` $(LDFLAGS) -o $(TARG) $(OFILES) $(LIBS) $(LDADD)
+tlsclient: cpu.$O $(LIBS)
+	$(CC) `pkg-config $(OPENSSL) --libs` -o $@ $^
 
-login_-dp9ik: $(LIBS) p9any.$O bsd.$O
-	$(CC) -o login_-dp9ik p9any.$O bsd.$O $(LIBS)
+login_-dp9ik: bsd.$O $(LIBS)
+	$(CC) -o $@ $^
 
-pam_p9.so: $(LIBS) p9any.$O pam.$O
-	$(CC) -shared -o pam_p9.so p9any.$O pam.$O $(LIBS)
+pam_p9.so: pam.$O $(LIBS)
+	$(CC) -shared -o $@ $^
 
-cpu.$O: cpu.c
-	$(CC) `pkg-config $(OPENSSL) --cflags` $(CFLAGS) cpu.c -o cpu.o
+%.$O: %.c
+	$(CC) `pkg-config $(OPENSSL) --cflags` $(CFLAGS) $< -o $@
 
-p9any.$O: p9any.c
-	$(CC) $(CFLAGS) p9any.c -o p9any.o
-
-pam.$O: pam.c
-	$(CC) $(CFLAGS) pam.c -o pam.o
-
-bsd.$O: bsd.c
-	$(CC) $(CFLAGS) bsd.c -o bsd.o
-
-.PHONY: clean
-clean:
-	rm -f *.o */*.o */*.a *.a $(TARG) pam_p9.so login_-dp9ik
-
-.PHONY: libauthsrv/libauthsrv.a
 libauthsrv/libauthsrv.a:
 	(cd libauthsrv; $(MAKE))
 
-.PHONY: libmp/libmp.a
 libmp/libmp.a:
 	(cd libmp; $(MAKE))
 
-.PHONY: libc/libc.a
 libc/libc.a:
 	(cd libc; $(MAKE))
 
-.PHONY: libsec/libsec.a
 libsec/libsec.a:
 	(cd libsec; $(MAKE))
 
-linuxdist: tlsclient pam_p9.so
-	tar cf tlsclient.tar tlsclient pam_p9.so
-	gzip tlsclient.tar
+.PHONY: clean
+clean:
+	rm -f *.o lib*/*.o lib*/*.a tlsclient pam_p9.so login_-dp9ik
 
-obsddist: tlsclient login_-dp9ik
-	tar cf tlsclient-obsd.tar tlsclient login_-dp9ik
-	gzip tlsclient-obsd.tar
+linux.tar.gz: tlsclient pam_p9.so tlsclient.1
+	tar c $^ | gzip > $@
+
+obsd.tar.gz: tlsclient login_-dp9ik tlsclient.1
+	tar c $^ | gzip > $@
+
+.PHONY: tlsclient.install
+tlsclient.install: tlsclient tlsclient.1
+	cp tlsclient $(PREFIX)/bin
+	cp tlsclient.1 $(PREFIX)/man/man1/