General > General Programming

POLYMAKE needed

<< < (2/4) > >>

alexdedalus:
The original MAKEFILE.MAK:

# PolyMake file

#--- C modules
#    CAVEAT -- set environment variables thusly
#      SET CL=/Od /Zi
#      SET LINK=/CO
#    The demo code was compiled with CL=/Oilt
#    Using CL=/Ox causes some problems with the zoom box...


cmod=S

array.obj    : array.c array.h data.h driver.h extmath.h graphics.h \
                screen.h serial.h
driver.obj   : driver.c driver.h data.h array.h extmath.h keyboard.h \
                screen.h scrnfile.h serial.h utility.h vertint.h zplane.h
extmath.obj  : extmath.c extmath.h driver.h
keyboard.obj : keyboard.c keyboard.h data.h driver.h array.h screen.h zplane.h
screen.obj   : screen.c screen.h data.h driver.h graphics.h keyboard.h
scrnfile.obj : scrnfile.c scrnfile.h driver.h screen.h
serial.obj   : serial.c serial.h driver.h utility.h
utility.obj  : utility.c utility.h data.h driver.h
zplane.obj   : zplane.c zplane.h data.h driver.h array.h screen.h keyboard.h

#--- ASM modules

data.obj     : data.asm defines.inc

graphics.obj : graphics.asm graphics.h defines.inc macros.inc
vertint.obj  : vertint.asm vertint.h defines.inc macros.inc


#--- LINK process

MNAME=driver

MODS1=array data extmath
MODS2=keyboard graphics scrnfile
MODS3=screen serial utility
MODS4=vertint zplane

$(MNAME).exe : $(MNAME).obj $[f,,$(MODS1),obj] $[f,,$(MODS2),obj] $[f,,$(MODS3),obj] $[f,,$(MODS4),obj]
 tm start /n /c1
 link /M /ST:4096 <@<
$[f,$(.PATH.obj),$(MNAME),obj]+
$[f,$(.PATH.obj),$(MODS1),obj]+
$[f,$(.PATH.obj),$(MODS2),obj]+
$[f,$(.PATH.obj),$(MODS3),obj]+
$[f,$(.PATH.obj),$(MODS4),obj]
$[r,$*]
$(wk)$[r,$*]
ct5_m5$(cmod);
<
 tm stop  "------link" /n /c1

--------------------------------------
XXXXXXXXXXXXXXXXXXXXXXXXX
--------------------------------------
XXXXXXXXXXXXXXXXXXXXXXXXX
-------------------------------------

I recently discovered that POLYMAKE in addition to MAKEFILE.MAK, also uses a second file, BUILTINS.MAK :

# default make procedures

#-- workaround for disappearing OBJ files...
.PRECIOUS

#-- put all OBJ files on RAM disk
.PATH.obj=g:

#-- put working files on RAM disk
wk=g:

#-- set up C model
cmod=S

#-- do single-module assembly
#--  /ZI turns on CodeView info
.asm.obj :
 tm start /n /c1
 masm /MX /N /P /T /W2 /ZI \
    $[r,$*],$(.PATH.obj)$[r,$*],$(wk)$[r,$*],NUL
 tm stop  "------masm" /n /c1

#-- single-module C compile
.c.obj :
 tm start /n /c1
 cl /Fo$(.PATH.obj) /Fs$(wk) /V"Nisley Micro Consulting" \
    /W3  /A$(cmod) /Sl132 /Sp79 /c \
    $[r,$*].c
 tm stop  "--------cl" /n /c1

#-- single-module link
.obj.exe :
 tm start /n /c1
 link /M <@<
$(.PATH.obj)$[r,$*]
$[r,$*]
$(wk)$[r,$*]
ct5_m5$(cmod)+
capi_$(cmod)+
scode_$(cmod);
<
 tm stop  "------link" /n /c1


#-- EXE file conversions
.exe.com :
        exe2bin $[r,$*] $[r,$*].COM
        del $[r,$*].exe

.exe.bin :
        exe2bin $[r,$*] $[r,$*].BIN
        del $[r,$*].exe

.exe.sys :
        exe2bin $[r,$*] $[r,$*].SYS
        del $[r,$*].exe

#-- AVMAC51 assembler to hex file, single module only!

.asm.hex :
     AVMAC51 $[r,$*] OJ=$(.PATH.obj)$[r,$*] PR=$(wk)$[r,$*] MF=$(wk)$[r,$*].MXP PW=130
     AVLINK <@<
$[r,$*].hex=$(.PATH.obj)$[r,$*].obj
< MA=$(.PATH.obj)$[r,$*].MAP SY=$[r,$*].SYM -SM -SP -SN

alexdedalus:
My version adapted to run with the traditional make of MS C 5.1 msdos.

COMP=cl
cmod=S
ARGC=/W3 /A$(cmod) /Sl132 /Sp79 /c
ASM=masm
ARGM=/MX /N /P /T /W2 /ZI
LINC=link
ARGL=/M /ST:4096

array.obj    : array.c array.h data.h driver.h extmath.h graphics.h screen.h serial.h
               $(COMP) $(ARGC) array.c

driver.obj   : driver.c driver.h data.h array.h extmath.h keyboard.h screen.h scrnfile.h serial.h utility.h vertint.h zplane.h
               $(COMP) $(ARGC) driver.c

extmath.obj  : extmath.c extmath.h driver.h
               $(COMP) $(ARGC) extmath.c

keyboard.obj : keyboard.c keyboard.h data.h driver.h array.h screen.h zplane.h
               $(COMP) $(ARGC) keyboard.c

screen.obj   : screen.c screen.h data.h driver.h graphics.h keyboard.h
               $(COMP) $(ARGC) screen.c

scrnfile.obj : scrnfile.c scrnfile.h driver.h screen.h
               $(COMP) $(ARGC) scrnfile.c

serial.obj   : serial.c serial.h driver.h utility.h
               $(COMP) $(ARGC) serial.c

utility.obj  : utility.c utility.h data.h driver.h
               $(COMP) $(ARGC) utility.c

zplane.obj   : zplane.c zplane.h data.h driver.h array.h screen.h keyboard.h
               $(COMP) $(ARGC) zplane.c

data.obj     : data.asm defines.inc
               $(ASM) $(ARGM) data.asm
 
graphics.obj : graphics.asm graphics.h defines.inc macros.inc
               $(ASM) $(ARGM) graphics.asm

vertint.obj  : vertint.asm vertint.h defines.inc macros.inc
               $(ASM) $(ARGM) vertint.asm

MNAME=driver

MODS1=array data extmath
MODS2=keyboard graphics scrnfile
MODS3=screen serial utility
MODS4=vertint zplane

$(MNAME).exe : array.obj data.obj extmath.obj keyboard.obj graphics.obj scrnfile.obj screen.obj serial.obj utility.obj vertint.obj zplane.obj
 $(LINC) /M /ST:4096 $(MODS1) $(MODS2) $(MODS3) $(MODS4),$(MNAME),ct5_m5$(cmos)+capi_$(cmod)+scode_$(cmod)

--------------------------
Why doesn't this work with the make that comes with Microsoft C 5.1?
What is wrong?

ebbe:
I can answer your question about the make tool supplied with MS C 5.1 though: That tool nowhere near as capable as PolyMake, in fact it is not really worthy of the name 'make'.

Back in the day, I used to be able to make PolyMake jump through burning hoops. However, "Back in the day" is literally 30 years ago and I can no longer remember what the different transformation macros ($[f,...] and such) do. But let's see what we can do in this day and age:


* Can I assume that the compiler is MS C 5.1?
* And that you have a machine that this compiler runs on?
* If so, what kind of machine?
* And are there other tools available on it??

edwardn9:
$[f,<path>,<list>,<ext>]   Build filename from <path>, <list>, and <ext>
$[r,<text>]                Base name of <text>
$*                         Path name of the target minus the extension


Microsoft NMAKE from back in the day will not process these.

alexdedalus:
ebbe, I'm using an 86Box emulator, but I can naturally switch to another emulator if you deem it necessary, such as PCem, DosBox, or even VMWare. I have them all installed.

I already tried to use the C Lattice compiler, but not even the make source, it managed to compile.
So not to complicate things, I'm back to MSC5.1, and I'll try to translate MAKEFILE.MAK to a version that is understandable by MASM's make (anyone up for this challenge?).

If anyone has any other "make" available, that has the executable that runs under msdos, I would be very grateful.

Some msdos repository must have a polymake for msdos, I'm still looking through the most popular repositories, but there must be hundreds of them, and maybe someone with luck will be able to find it.

These last lines in the original makefile:

$[f,$(.PATH.obj),$(MNAME),obj]+
...
...
...

, I think they are completely unnecessary, as we don't see lines like that, in traditional Makefiles, nor in UNIX. I believe they can be replaced naturally to make it compatible with the traditional makefile. Well, it's not a complication like that, which the command line of the LINK program will need to do its job.

And that's exactly what I'm doing, according to my post above, with my MAKEFILE modified, to be compatible with the traditional make of MS C and/or MASM.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version