[Coco] OS-9 / NitOS-9 C programmers, lend me your makefiles

Bill Pierce ooogalapasooo at aol.com
Thu Nov 12 14:10:46 EST 2020


Try this on for size... This is Mike Knudsen's makfile for UltiMusE3. This makefile compiles some 100+ sources into the 9 files that make up the Umuse3 suite.

I actually have some for MShell that become more detailed than this.

https://github.com/BGPierce/CocoRepo/tree/master/OS-9/APPS/C_RMA/ULTIMUSE3


-----Original Message-----
From: William Carlin <whcarlinjr at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Thu, Nov 12, 2020 12:11 pm
Subject: [Coco] OS-9 / NitOS-9 C programmers, lend me your makefiles

OS-9 / NitOS-9 C programmers,

Share with me your most complex makefile(s).  I want to see what is
possible with both Tandy make and more specifically, Tim Koonce's (TK) make.

Most of my information is coming from the Tandy make documentation.
Getting information online seems to be mostly focused on GNU make, which is
vastly more advanced than what we had available in in 1991.  It's nearly
impossible to find documentation or examples of makefiles from the K&R C
era.

I am just getting my feet wet but here is my most complex example.  This is
a makefile to make Tim's make.

[Makefile]
# Makefile for make!

RDIR        = ../RELS
ODIR        = /dd/usr/src/make91/cmds/
EXEC        = make
DESTDIR    = /DD/TMP
USRBIN      = USR/BIN
CFLAGS      += -T=/R0 -e5 -dDEBUG
ROBJS      = $(RDIR/)check.r $(RDIR/)input.r $(RDIR/)macro.r
$(RDIR/)main.r \
$(RDIR/)make.r $(RDIR/)reader.r $(RDIR/)rules.r $(RDIR/)files.r
OBJS        = check.r input.r macro.r main.r make.r reader.r rules.r files.r
SRCS        = check.c input.c macro.c main.c make.c reader.c rules.c files.c

make:      $(OBJS)
            cc $(ROBJS) $(CFLAGS) -f=$(ODIR)$(EXEC)
            cp -ov $(ODIR)$(EXEC) /r0/$(EXEC)

$(OBJS):    h.h

$(ROBJS):  $(OBJS)

clean:      $(ROBJS)
            del $?
            del $(ODIR)$(EXEC)

copy:      $(EXEC)
            cp -ov $(ODIR)$(EXEC) /r0/$(EXEC)

install:    $(EXEC)
            makdir $(DESTDIR)/$(USRBIN)
            cp -ov $(ODIR)$(EXEC) $(DESTDIR)/$(USRBIN)/$(EXEC)
[EOF]

Notice the new '+=' operator for CFLAGS.  This is my current addition to TK
make that I am working on.  I wanted to keep the macro definitions from the
/dd/sys/make.default file and append what I am defining in the project
makefile to the existing definition.  The last part that is kicking my butt
is allowing a macro append from the command line.  It just keeps locking
up.  My debug code shows that I am processing the *argv correctly when the
macro is passed to the setmacro() function but then it goes udders up from
there.  Probably has to do with how I'm manipulating the pointers to char
or maybe with the malloc() space for char pointers.

William Carlin

-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list