changeset 8:23c546c01f17

fix clean target, add it_production (now default) and it_debug targets
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 29 Jan 2025 18:46:57 +0000
parents 795a604776d9
children 79b6f035cd96
files Makefile
diffstat 1 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Jan 29 18:35:12 2025 +0000
+++ b/Makefile	Wed Jan 29 18:46:57 2025 +0000
@@ -2,7 +2,7 @@
 
 SHELL=/bin/sh
 
-default: it
+default: it_production
 
 alloc.a: \
 makelib alloc.o
@@ -165,12 +165,12 @@
 	./instcheck
 
 clean:
-	rm *.o *.a
-	rm cdbget cdbmake cdbdump cdbstats cdbtest cdbmake-12 cdbmake-sv rts testzero
+	rm -f *.o *.a
+	rm -f cdbget cdbmake cdbdump cdbstats cdbtest cdbmake-12 cdbmake-sv rts testzero
 	rm -rf rts-tmp
-	rm auto-str install instcheck compile makelib systype
-	rm conf-home conf-cc conf-ld load
-	rm auto_home.c uint32.h
+	rm -f auto-str install instcheck compile makelib systype
+	rm -f conf-home conf-cc conf-ld load
+	rm -f auto_home.c uint32.h
 compile: \
 warn-auto.sh conf-cc
 	( cat warn-auto.sh; \
@@ -178,6 +178,12 @@
 	) > compile
 	chmod 755 compile
 
+debug:
+	sed "1s@FIXME@$HOME@" conf-home.ac > conf-home
+	sed '1s/CFLAGS/-O -dgdb/' conf-cc.ac > conf-cc
+	sed '1s/LDFLAGS//' conf-ld.ac > conf-ld
+	chmod +x conf-??
+
 error.o: \
 compile error.c error.h
 	./compile error.c
@@ -210,8 +216,11 @@
 compile instcheck.c strerr.h error.h readwrite.h exit.h
 	./compile instcheck.c
 
-it: \
-prog install instcheck
+it_production: \
+production prog install instcheck
+
+it_debug: \
+debug prog install instcheck
 
 load: \
 warn-auto.sh conf-ld
@@ -249,6 +258,12 @@
 compile open_trunc.c open.h
 	./compile open_trunc.c
 
+production:
+	sed "1s@FIXME@$HOME@" conf-home.ac > conf-home
+	sed '1s/CFLAGS/-O2/' conf-cc.ac > conf-cc
+	sed '1s/LDFLAGS/-s/' conf-ld.ac > conf-ld
+	chmod +x conf-??
+
 prog: \
 cdbget cdbmake cdbdump cdbstats cdbtest cdbmake-12 cdbmake-sv rts \
 testzero