Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user nurd ! (Registered 2024-06-16) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Cross Development using Makefile
2013-01-25 14:45
Burglar

Registered: Dec 2004
Posts: 1051
Cross Development using Makefile

Weekend didn't even start for most of you yet, but here it is ;)

Cross Development using Makefile

comments and improvements are of course very welcome.

enjoy and may your build times be short!

make -j16
 
... 37 posts hidden. Click here to view all posts....
 
2013-01-28 11:26
spider-j

Registered: Oct 2004
Posts: 452
Thanks for the rant, Burglar! I finally wrote my first Makefile \o/

But I've got the problem that make everytime builds everything from scratch; even when none of the source or dependencies files was changed (i.e. when I type 'make' two times in the shell like you wrote in the rant).

Here's my Makefile:
ASS=acme
ASSFLAGS=-v4
LIBPATH=/usr/share/acme/6502
LIBS=$(LIBPATH)/kernal.a $(LIBPATH)/static.a $(LIBPATH)/macros.a
PACKER=exomizer
PACKERFLAGS=sfx 2064 -n
BINARYDIR=../bin
OBJECTS=loader.prg rasters.prg
RM=rm -f

all: $(OBJECTS)

%.prg: %.asm $(LIBS)
	$(ASS) $(ASSFLAGS) $<
	$(PACKER) $(PACKERFLAGS) -o $(BINARYDIR)/$@ $@
	$(RM) $@

loader.prg: loader.asm include/gemischt.prg include/randomtab2.prg

rasters.prg: rasters.asm include/ballsprites.spr include/border-empty-sprites.spr include/demotune01.c64.prg include/mydpetsciilogo.prg include/spider-logo-sprites.spr

clean:
	$(RM) $(BINARYDIR)/*
2013-01-28 12:33
blackwine

Registered: Jan 2013
Posts: 3
Spider, remove:
	$(RM) $@

And try again. The problem is that you define your $(OBJECTS), but you remove them and pack them elsewhere. If you have some intermediate objects you can define them using e.g:
.INTERMEDIATE:  loader-not-packed.prg rasters-not-packed.prg
2013-01-28 15:13
spider-j

Registered: Oct 2004
Posts: 452
Thanks for the hint. Still I don't understand completely how to get it working like I want.

Gotta try out a few things... :-)
2013-01-28 15:18
Mr. SID

Registered: Jan 2003
Posts: 424
Useful hint: running "make -d" outputs lots of debug information to help with problems like that...
2013-01-28 18:07
Burglar

Registered: Dec 2004
Posts: 1051
@Dr.J, ah yes Windows... groepaz and JackAsser already told you, but, use cygwin! ;)
That's the best option, or just install linux or get a mac.
GNU make runs on Linux/BSD/OSX/*nix and probably more.

nmake might do the tricks you need, but I cant really say as I don't use
windows anymore. Also, stackoverflow has some info on it that might help you too.

@spider, as BlackWine said, you rm/delete the object right after you build it ;)
You'll want to do one step at a time, not combine them.

I would do it like this, with a seperate compile rule and a seperate pack rule.
OBJECTS=loader.exo rasters.exo

# a .prg is a compiled .asm
%.prg: %.asm $(LIBS)
	$(ASS) $(ASSFLAGS) $<

# a .exo is a packed .prg
%.exo: %.prg
    $(PACKER) $(PACKERFLAGS) $< -o $@

all: $(OBJECTS)

loader.prg: loader.asm include/gemischt.prg include/randomtab2.prg

rasters.prg: rasters.asm include/ballsprites.spr include/border-empty-sprites.spr include/demotune01.c64.prg include/mydpetsciilogo.prg include/spider-logo-sprites.spr

clean:
    rm -f *.exo
2013-01-28 22:28
King Durin
Account closed

Registered: Oct 2007
Posts: 85
GNU Make for Win32 works just fine, especially if you also install the GNU For Win32 library on your system and put the gnu\bin folder on the path. Cygwin, etc, not necessary.
2013-01-29 14:19
chatGPZ

Registered: Dec 2001
Posts: 11154
one day also you will come to the point where things do not actually quite work as intended - and cygwin is it then =) i'd just recommend to use it from the start, because it will save you a lot of frustrating WTF moments.
2020-03-28 09:00
soci

Registered: Sep 2003
Posts: 474
Sorry for digging an old thread up but I wanted to share this just in case it's useful to some.

For projects with a lot of files manually managing the prerequisite lists started to get annoying. Especially if I missed something. I learned that this can be automated by including the dependency list from an external file.

Fine my assembler had the "-M" option to write dependencies into a file which I normally copy-pasted into the Makefile. Including it sort of worked but failed when something was removed or renamed as those files were now missing. Dummy rules could have prevented this of course but were not present either. So I had to create a new "--make-phony" option recently to produce them and now it works.

Here's a minimal Makefile:
demo.prg: demo.asm demo.dep
	64tass --make-phony -M demo.dep $< -o $@

demo.dep:
-include demo.dep
The target needs to depend on the main source file and the dependency list file. As the dependency list file itself may not exists at first there's a dummy rule for this and the include is prefixed with a "-" to prevent errors.
2020-03-28 11:13
tlr

Registered: Sep 2003
Posts: 1731
Very useful!

I'm considering switching assembler for superfluid as the current dasm flow is rather messy. Automatic dependencies would be helpful as there are a lot of files to track.
2020-03-28 17:30
MagerValp

Registered: Dec 2001
Posts: 1060
Agreed, it's a huge time saver. ca65 has a --create-dep option that does the same thing.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Guests online: 79
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Aliens in Wonderland  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Daah, Those Acid Pil..  (9.5)
9 Birth of a Flower  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Stinsen  (9.7)
3 Jeroen Tel  (9.6)
4 Linus  (9.6)
5 psych858o  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.