Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


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

Registered: Dec 2004
Posts: 810
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
 
... 18 posts hidden. Click here to view all posts....
 
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
Groepaz

Registered: Dec 2001
Posts: 9228
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: 443
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: 1289
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: 975
Agreed, it's a huge time saver. ca65 has a --create-dep option that does the same thing.
2020-03-28 17:51
Oswald

Registered: Apr 2002
Posts: 4567
what hapens if demo.dep doesnt exist yet, or if I change the includes in the src, and make goes for the first time around ?
2020-03-28 18:07
Groepaz

Registered: Dec 2001
Posts: 9228
usually you have seperate rule that just generates the .dep file when it does not exist. and you trigger that rule manually when the includes change (or just always if its quick enough)
2020-03-28 18:30
soci

Registered: Sep 2003
Posts: 443
Nothing interesting happens. If a file is missing with a dummy rule it's a change and of course modifying an include line in one of the sources is a change. The resulting compilation creates an updated demo.dep file and all is well.

A separate target may be necessary if dependency generation is not done at the same time as the compilation. For example when it's done by a separate program and it's somehow slow.

Until now I too thought this should be done in a separate target like Groepaz said and so there were no dummy rules generated. After all in that workflow you generate them manually and therefore there won't be any missing files. And if there were it was the reason to run it ;)

But generating them always is fast enough for me.
2020-03-28 18:32
Groepaz

Registered: Dec 2001
Posts: 9228
seperate rule is just a convention from old GNU times i think, when it took quite a while :)
2020-03-30 08:27
Zirias

Registered: Jan 2014
Posts: 47
At least GNU make will re-read rules when one of the makefiles changes -- not sure what other flavors of make do.
Previous - 1 | 2 | 3 - 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
Optic Freeze/G★P
Neo-Rio
CyberBrain/NoName
grasstust/Hoaxers
Guests online: 57
Top Demos
1 Uncensored  (9.7)
2 Coma Light 13  (9.7)
3 Edge of Disgrace  (9.7)
4 Comaland 100%  (9.6)
5 Unboxed  (9.6)
6 The Shores of Reflec..  (9.6)
7 Remains  (9.6)
8 NGC 1277 100%  (9.5)
9 Lunatico  (9.5)
10 D50  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.6)
2 HouseScroller  (9.6)
3 Crystal Gazer  (9.6)
4 Smile to the Sky  (9.5)
5 The Tuneful Eight [u..  (9.5)
6 Instinct  (9.5)
7 Rewind  (9.5)
8 Bad Boy  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Gumbo Revised  (9.4)
Top Groups
1 PriorArt  (9.6)
2 Oxyron  (9.4)
3 Booze Design  (9.4)
4 Censor Design  (9.4)
5 Performers  (9.4)
Top Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.7)
4 The Elegance  (9.4)
5 Mermaid  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.046 sec.