[comp.os.minix] MacMinix /usr/src/commands/mac/Makefile

paul@ukpoit.co.uk (Paul Wood) (01/16/91)

I recently posted a Makefile for /usr/src/commands/mac. Also I did say that
it could be improved :-)

There have been so many changes to MacMinix recently that I have got a little
lost, so I decided to reload MacMinix, and keep a log of everything that I did.
And in the process I lost my /usr/src/commands/mac/Makefile ... Whoops! ... so
I had to start again.

To make this one work it was necessary to copy /usr/src/commands/mac/ar/out.h
into /usr/src/commands/mac. I hope this is the correct file. This means that I
now have two copies of out.h (which is certainly not correct), the alternative
would be to amend the source files which use out.h, so that they pick it up
from the correct place. But where is the correct place? Perhaps Joe Pickert
could decide?

The "install" option could be improved, I think. I am open to suggestions.

Also, it currently does not make those programs in sub-directories of
/usr/src/commands/mac, and it should.

Here is my new-and-improved version:
-----8<-------------------------------------------------------------------------
PROGS=	anm aoutdump asize astrip cc cv eject hdclose hdopen maccreate macfile settype

START=	/usr/lib/crtso.o
LIBS=	/usr/lib/libmac.a /usr/lib/libc.a
END=	/usr/lib/end.o
CFLAGS=	-c -D_MINIX -D_POSIX_SOURCE
LDFLAGS=-c -a0:2 -a1:2 -a2:2 -a3:2

.c:
	@echo COMPILING $*
	cc $(CFLAGS) -o $*.o $<
	/usr/lib/ld $(LDFLAGS) \
	    -o $*.out $(START) $*.o $(LIBS) $(END)
	@rm -f $*.o
	/usr/lib/cv $*.out $*
	@rm -f $*.out
	@if test "$*" = "cv"; then chmem =32768 $*; else chmem =8192 $*; fi
	@chmod 755 $*
	@chown bin $*
	@chgrp bin $*

all:	$(PROGS)
anm:	anm.c out.h $(LIBS)
aoutdump:	aoutdump.c out.h $(LIBS)
asize:	asize.c out.h $(LIBS)
astrip:	astrip.c out.h $(LIBS)
cc:	cc.c $(LIBS)
cv:	cv.c out.h $(LIBS)
eject:	eject.c $(LIBS)
hdclose:	hdclose.c $(LIBS)
hdopen:	hdopen.c $(LIBS)
maccreate:	maccreate.c $(LIBS)
macfile:	macfile.c $(LIBS)
settype:	settype.c $(LIBS)

install:
	@(test -f anm && echo INSTALLING anm in /usr/bin                     \
	    && strip anm && mv anm /usr/bin; exit 0)
	@(test -f aoutdump && echo INSTALLING aoutdump in /usr/bin           \
	    && strip aoutdump && mv aoutdump /usr/bin; exit 0)
	@(test -f asize && echo INSTALLING asize in /usr/bin                 \
	    && strip asize && mv asize /usr/bin; exit 0)
	@(test -f astrip && echo INSTALLING astrip in /usr/bin               \
	    && strip astrip && mv astrip /usr/bin; exit 0)
	@(test -f cc && echo INSTALLING cc in /usr/bin                       \
	    && strip cc && mv cc /usr/bin; exit 0)
	@(test -f cv && echo INSTALLING cv in /usr/bin                       \
	    && strip cv && mv cv /usr/bin; exit 0)
	@(test -f eject && echo INSTALLING eject in /usr/bin                 \
	    && strip eject && mv eject /usr/bin; exit 0)
	@(test -f hdclose && echo INSTALLING hdclose in /usr/bin             \
	    && strip hdclose && mv hdclose /usr/bin; exit 0)
	@(test -f hdopen && echo INSTALLING hdopen in /usr/bin               \
	    && strip hdopen && mv hdopen /usr/bin; exit 0)
	@(test -f maccreate && echo INSTALLING maccreate in /usr/bin         \
	    && strip maccreate && mv maccreate /usr/bin; exit 0)
	@(test -f macfile && echo INSTALLING macfile in /usr/bin             \
	    && strip macfile && mv macfile /usr/bin; exit 0)
	@(test -f settype && echo INSTALLING settype in /usr/bin             \
	    && strip settype && mv settype /usr/bin; exit 0)
-----8<-------------------------------------------------------------------------

I still don't have a modem attached to my Mac, so this code has been re-typed
on my unix machine at work, and is thus untested. My apologies for any typos.

Paul Wood                                 | UUCP Mail:  paul@ukpoit.co.uk
31 Buttermere Drive, Dronfield Woodhouse, | Bang-Style: ...!ukc!ukpoit!paul
Sheffield, England, S18 5PX               | Voice:      +44 246 418031