From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- unix/shlib/mkpkg | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 unix/shlib/mkpkg (limited to 'unix/shlib/mkpkg') diff --git a/unix/shlib/mkpkg b/unix/shlib/mkpkg new file mode 100644 index 00000000..4b364873 --- /dev/null +++ b/unix/shlib/mkpkg @@ -0,0 +1,103 @@ +# Make the Sun/IRAF shared library. + + +$call relink +$exit + +update: + $call relink + $call install + $iffile (V.o) $call clean $endif + ; + +relink: + $set rebuild = no + $goto relink_ +Relink: + $set rebuild = yes +relink_: + $set ADDR = 10000000 + $set VV = "$$(@S.ver.$(MACH))" + + $ifeq (OSVERSION, 4) + $set SI = bin$$S$(VV).e + $else + $set SI = bin$$S$(VV)_$(OSRELEASE).e + $endif + + $set L1 = + $set L2 = + $set L3 = + $set L4 = + + $ifnfile ($(SI), lib$libshare.a) + $set rebuild = yes + $else $ifolder ($(SI): $(L1), $(L2), $(L3), $(L4), Slib.c) + $set rebuild = yes + $end + + $ifeq (rebuild, yes) + $ifeq (OSVERSION, 4) + !./mkshlib.sos4 -a $(ADDR) + $else + !./mkshlib.ssol -a $(ADDR) + $endif + $call libshare + $else + $echo "shared library is up to date" + $endif + ; + +install: + $set VV = "$$(@S.ver.$(MACH))" + $ifeq (OSVERSION, 4) + $set SI = S$(VV).e + $else + $set SI = S$(VV)_$(OSRELEASE).e + $endif + + $iffile (S.e) + $iffile (bin$$$(SI).2) $move bin$$$(SI).2 bin$$$(SI).3 $endif + $iffile (bin$$$(SI).1) $move bin$$$(SI).1 bin$$$(SI).2 $endif + $iffile (bin$$$(SI) ) $move bin$$$(SI) bin$$$(SI).1 $endif + $move S.e bin$$$(SI) + $move libshare.a bin$ + $iffile (bin$$$(SI).1, bin$$$(SI).2, bin$$$(SI).3) + !(find $(iraf)bin/$(SI).[123] -atime +1 -exec rm {} \;) + $endif + $endif + ; + +libshare: +libshare.a: + $set SYSF = onentry.o + $omake S.s + !ar xv $(iraf)bin.$(MACH)/libsys.a $(SYSF) + !ar rv libshare.a S.o $(SYSF); ranlib libshare.a; rm -f $(SYSF) + $endif + ; + +coff: +coff.e: + $omake coff.c + !cc coff.o -o coff.e + ; + +edsym: +edsym.e: + $ifeq (OSVERSION, 4) + $omake edsym-sos4.c + !cc edsym-sos4.o -o edsym.e + $else + $omake edsym-ssol.c + !cc edsym-ssol.o -lelf -o edsym.e + $endif + ; + +clean: + $ifeq (OSVERSION, 4) + !./mkshlib.sos4 -c + $else + !./mkshlib.ssol -c + $endif + ; -- cgit