| |
Burglar
Registered: Dec 2004 Posts: 1031 |
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.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11091 |
dr.j has brought up an important point .... if you are stuck on windows for some reason, you need a "how to install and use cygwin" tutorial aswell, else even simple stuff like rm -f might not work correctly =)
(and dont even think about using make without a proper bash shell. yes it works for some simple stuff. BUT it will make your head explode once you get to the more advanced stuff, trust me) |
| |
JackAsser
Registered: Jun 2002 Posts: 1987 |
Quote: dr.j has brought up an important point .... if you are stuck on windows for some reason, you need a "how to install and use cygwin" tutorial aswell, else even simple stuff like rm -f might not work correctly =)
(and dont even think about using make without a proper bash shell. yes it works for some simple stuff. BUT it will make your head explode once you get to the more advanced stuff, trust me)
Actually you get quite far by installing nmake from microsoft and then unixtools for windows. But then again cygwin is a more general approach, pity the io-wrapper is so damn slow. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11091 |
"Actually you get quite far by installing nmake from microsoft and then unixtools for windows."
lets say you can make some things work. until you notice that some things only work halfway as intended. and then you will encounter something that doesnt work at all and install cygwin. =)
and ofcourse nmake works differently from gnu make. not to say it seriously sucks arse :) |
| |
JackAsser
Registered: Jun 2002 Posts: 1987 |
:P |
| |
Trap
Registered: Jul 2010 Posts: 222 |
Thank you Burglar for writing this.
Excellent stuff!!! |
| |
spider-j
Registered: Oct 2004 Posts: 443 |
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)/*
|
| |
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 |
| |
spider-j
Registered: Oct 2004 Posts: 443 |
Thanks for the hint. Still I don't understand completely how to get it working like I want.
Gotta try out a few things... :-) |
| |
Mr. SID
Registered: Jan 2003 Posts: 421 |
Useful hint: running "make -d" outputs lots of debug information to help with problems like that... |
| |
Burglar
Registered: Dec 2004 Posts: 1031 |
@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
|
Previous - 1 | 2 | 3 | 4 | 5 - Next |