Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many dependencies on $(PLVM02) in the makefile #41

Open
ZornsLemma opened this issue Mar 16, 2018 · 3 comments
Open

Many dependencies on $(PLVM02) in the makefile #41

ZornsLemma opened this issue Mar 16, 2018 · 3 comments

Comments

@ZornsLemma
Copy link
Collaborator

Hi Dave,

I'm updating my Acorn port to the latest master as a stepping stone to working on the new 2.0 stuff and I've noticed a small problem with the way the makefile is set up.

I found this "naturally" by trying to build my port, but you can see the problem most simply by taking current master HEAD (28571b4) and applying this small patch:

diff --git a/src/makefile b/src/makefile
index ed475b1..e5c8573 100755
--- a/src/makefile
+++ b/src/makefile
@@ -78,7 +78,7 @@ TXTTYPE       = .TXT
 apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVM802) $(PLVM03) $(CMD) $(PLASMAPLASM) $(CODEOPT) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(SOS) $(ROD) $(SIEVE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(GRAFIX) $(GFXDEMO) $(DGR) $(DGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ)
        -rm vmsrc/plvmzp.inc
 
-c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64) 
+c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64) $(SIEVE)
        -rm vmsrc/plvmzp.inc
 
 all: apple c64
diff --git a/src/vmsrc/apple/plvm02.s b/src/vmsrc/apple/plvm02.s
index 9e58eac..2833a2f 100755
--- a/src/vmsrc/apple/plvm02.s
+++ b/src/vmsrc/apple/plvm02.s
@@ -9,6 +9,7 @@
 ;*
 ;* MONITOR SPECIAL LOCATIONS
 ;*
+!ERROR "FOO"
 CSWL    =       $36
 CSWH    =       $37
 PROMPT  =       $33

What this does is:

  • break the Apple II build (somewhat artificially, of course)
  • builds SIEVE as part of the C64 port (because we want to include it on a disk image, say)

The problem is that if you do a C64 build, it fails because it's trying to build the Apple II code (because SIEVE depends on PLVM02):

$ make c64
...
acme -o rel/apple/PLASMA.SYSTEM#FF2000 -l vmsrc/apple/plvm02.sym vmsrc/apple/plvm02.s
Error - File vmsrc/apple/plvm02.s, line 12 (Zone <untitled>): !error: FOO
makefile:154: recipe for target 'rel/apple/PLASMA.SYSTEM#FF2000' failed
make: *** [rel/apple/PLASMA.SYSTEM#FF2000] Error 1

Obviously this example isn't very realistic and normally the Apple II code would build fine. What specifically triggered this in the case of my port is that I had removed JMPTMP from the Acorn plvmzp.inc and moved it into the Acorn plvm.s file. However, when building the Acorn port, the Apple PLVM02 gets built using the Acorn plvmzp.inc, and a mismatch occurs.

Now I could work around this by just ensuring that I define all the same symbols in the Acorn plvmzp.inc as are in the Apple plvmzp.inc, and that might be a good idea anyway, but I thought I should raise this as an issue anyway. It seems potentially confusing, maybe even dangerous, for building port X to build a broken (since it will use the wrong non-Apple zero page locations) version of the Apple II VM.

I don't have a great solution for this. I can hack around at the makefile and see if I can do anything with it, but I wanted to see how you felt about this before I do - if you don't see this as a problem then I won't worry about it. The obvious fix would be to remove the $(PLVM02) dependency from most of the demo files, but I don't know if that would have any unpleasant side efects.

Cheers.

Steve

@dschmenk
Copy link
Owner

Guess how upset I wouldn't be if we dumped this makefile and started from scratch :-)

@ZornsLemma
Copy link
Collaborator Author

Hah. :-) I'm having a go at a new version, I'll push a draft version up somewhere for you to take a look at soon-ish, maybe in a couple of hours.

@ZornsLemma
Copy link
Collaborator Author

OK, it's only a sketch but you might like to take a look at: https://github.com/ZornsLemma/PLASMA/tree/makefile-exp

The old makefile has been moved aside to makefile.old. There's now a new top-level makefile, a port-specific makefile.{apple,acorn} and a makefile.common.

You can do:

  • "make" to build both ports
  • "make acorn" to build the Acorn port
  • "make apple" to build the Apple port
  • "make clean" to clean everything
  • "make -f makefile.acorn" is an alternative way to build the Acorn port

I doubt this will work with anything except GNU make; I don't know if that's a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants