Only remove the directories if there's an obj/ or obj@
authortb <tb@openbsd.org>
Sat, 28 Aug 2021 15:20:19 +0000 (15:20 +0000)
committertb <tb@openbsd.org>
Sat, 28 Aug 2021 15:20:19 +0000 (15:20 +0000)
regress/lib/libcrypto/x509/Makefile

index 6b4256b..f394a93 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.5 2021/08/28 15:13:50 beck Exp $
+#      $OpenBSD: Makefile,v 1.6 2021/08/28 15:20:19 tb Exp $
 
 PROGS =        constraints verify x509attribute x509name
 LDADD= -Wl,-Bstatic -lcrypto -Wl,-Bdynamic
@@ -12,8 +12,10 @@ REGRESS_TARGETS=regress-constraints regress-verify regress-x509attribute regress
 CLEANFILES+=   x509name.result
 
 .if make(clean) || make(cleandir)
+. if ${.OBJDIR} != ${.CURDIR}
 .BEGIN:
-        rm -rf ${.OBJDIR}/[0-9]*
+        rm -rf [0-9]*
+. endif
 .endif
 
 regress-verify: verify