IRC logs for #openttd on OFTC at 2022-06-14
⏴ go to previous day
01:01:57 *** Vadtec has quit IRC (Ping timeout: 480 seconds)
02:09:30 *** Wormnest_ has quit IRC (Quit: Leaving)
02:45:13 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:25:21 *** Smedles has joined #openttd
05:30:59 *** andythenorth has joined #openttd
05:53:57 *** andythenorth has quit IRC (Quit: andythenorth)
06:00:07 *** andythenorth has joined #openttd
06:25:05 *** sla_ro|master has joined #openttd
07:10:31 <andythenorth> I forsee learning about make patterns in my future
07:13:09 <andythenorth> if I can convert all the targets to work on lists of deps instead of a single dep
07:13:40 <andythenorth> then if I can somehow pass the list as a shell arg or something
07:15:41 <dwfreed> make has a variable that means "all dependencies for this target"
07:16:42 <andythenorth> seems to be a magic var I'm seeing used in examples
07:17:21 <dwfreed> if you only want the deps that are newer than an existing target, there is $?
07:39:57 *** MaverickFischer_ has joined #openttd
07:40:46 *** MaverickFischer has quit IRC (Ping timeout: 480 seconds)
07:48:35 *** andythenorth has quit IRC (Quit: andythenorth)
07:52:08 *** andythenorth has joined #openttd
08:19:31 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
08:19:36 *** WormnestAndroid has joined #openttd
10:10:41 *** Etua has quit IRC (Quit: Etua)
10:22:42 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
10:22:58 *** WormnestAndroid has joined #openttd
10:26:49 *** D-HUND is now known as debdog
10:31:01 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
10:31:28 *** WormnestAndroid has joined #openttd
12:11:16 <andythenorth> dunno if a target can be a list
12:11:59 <andythenorth> SO overflow examples implies it can
12:25:10 <andythenorth> so this is a pattern thing? `grf-%: ...\n\t$(MAKE) PROJECT_NAME=$* grf`
12:25:31 <andythenorth> this is becoming a little bit clearer
12:25:53 <andythenorth> ok so I think I need to do the following
12:26:07 <andythenorth> 1) convert all the single-file targets and deps to lists with patterns
12:26:17 <andythenorth> 2) have the default list be 'all grfs'
12:26:33 <andythenorth> 3) provide an optional parameter to target a single roster (this already exists, but is only used by python currently)
12:26:49 <andythenorth> the case for building is e.g. 'moose' or 'all'
12:27:07 <andythenorth> the case of 'moose', 'ibex' combinations is not valid
13:11:50 <peter1138> Nice weather, shame I can't go out and play :-(
15:02:41 *** andythenorth has quit IRC (Quit: andythenorth)
15:17:52 *** dihedral has joined #openttd
15:20:07 *** sla_ro|master has quit IRC ()
15:22:32 *** andythenorth has joined #openttd
15:40:23 *** gelignite has joined #openttd
16:05:14 <FLHerne> It was. Chips, then cheese and red onion sandwich
16:06:59 *** Wormnest has joined #openttd
16:20:09 <FLHerne> (picture not current but I'm still here)
16:20:57 <andythenorth> hmm train is not in Iron Horse
16:22:36 *** virtualrandomnumber has joined #openttd
16:33:49 *** Smedles has joined #openttd
16:37:02 *** sla_ro|master has joined #openttd
16:42:55 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
16:50:46 <FLHerne> It would be just as bad in-game as in real life
16:58:40 *** HerzogDeXtEr has joined #openttd
18:22:07 <andythenorth> ok today is educate-the-clueless-about-makefiles-day
18:38:54 <andythenorth> it appears to kinda work
18:39:31 <andythenorth> but I've changed the logic with the lang / graphics deps, and I don't know how it worked, or if it still worked :P
18:42:21 <nielsm> wrong dependencies in a makefile can cause three kinds of issues: first is if you make a circular dependency, then I think you get errors. second is if you forgot to declare a dependency, then sometimes the target might not get made when it needs to. third is if you add unncessary dependencies, then your target might get made more often than it needs to.
18:43:08 <nielsm> actually nm, there's the fourth which is serious
18:43:42 <nielsm> that an undeclared dependency won't get made before the target, so the target gets made wrong or errors
18:48:38 <andythenorth> uuf this would be so much easier in python
19:07:18 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
19:10:54 *** uhren has quit IRC (Quit: Leaving)
19:12:26 <andythenorth> I thought maybe I was doing something make can't do
19:12:45 <andythenorth> but it seems this is really core purpose of make?
19:18:22 <nielsm> yes, the core concept of make is that you have targets made from dependencies, where both targets and dependencies are real files
19:19:34 <nielsm> the dependencies can either be source files or other targets in the makefile, and if any of the dependencies of a target has a newer modification time than the target file, then the target is considered out of date and needs to be rebuilt according to the "recipe" for that target
19:20:40 <andythenorth> specifically it's the pattern matching in lists that I thought might be 'doing make wrong'
19:20:52 <nielsm> and because software projects typically have lots of targets built in similar manners it supports generic targets like "an .o file can be made from a .c file by running this command"
19:21:39 <nielsm> I think the normal way is to assume that foo.nfo is built from foo.nml (basename remains the same, extension changes)
19:22:49 <andythenorth> that would hold here
19:23:00 <andythenorth> foo.grf depends on foo.nfo which depends on foo.nml
19:23:17 <andythenorth> foo.nml depends on a set of input files as determined by an external python script
19:23:30 <andythenorth> but foo.grf also depends on graphics and lang targets
19:25:17 <nielsm> I think there is also a way to have a separate dependency calculation step or have make read additional dependencies from somewhere
19:25:58 <nielsm> which can be used with C and C++ compilers that can output a list of included files so changing a header file automatically causes all dependent source files to be rebuilt
19:30:39 *** tokai|noir has joined #openttd
19:30:39 *** ChanServ sets mode: +v tokai|noir
19:37:36 *** tokai has quit IRC (Ping timeout: 480 seconds)
19:41:22 *** virtualrandomnumber has joined #openttd
19:41:28 *** virtualrandomnumber has quit IRC ()
19:48:53 <andythenorth> hmm need to strip some text from some var names
19:58:25 <andythenorth> this seems to sort of work, for the limited test case so far
19:58:29 <andythenorth> this is quite surprising to me
20:13:46 *** gelignite has quit IRC (Read error: Connection reset by peer)
20:14:50 *** gelignite has joined #openttd
20:14:50 *** geli has quit IRC (Read error: Connection reset by peer)
20:30:32 *** gelignite has quit IRC (Quit: Stay safe!)
20:40:36 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:46:21 *** MaverickFischer_ is now known as MaverickFischer
21:11:34 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
21:22:16 <andythenorth> it needs to use the GRF_FILES list, but it's not a targets: prerequisites type rule
21:31:57 <andythenorth> install is a phony target
21:32:27 *** Samu has quit IRC (Quit: Leaving)
21:41:24 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:51:20 *** sla_ro|master has quit IRC ()
22:03:45 <andythenorth> well this seems to work but eh
22:04:20 <andythenorth> $${GRF_FILE_PATH##*/} is copy-paste and the syntax highlighter for make hates it
22:04:34 <andythenorth> it seems to strip the dir name, not sure what the magic is
22:08:42 *** wallabra_ has joined #openttd
22:09:51 *** wallabra is now known as Guest2106
22:09:51 *** wallabra_ is now known as wallabra
22:13:37 *** Guest2106 has quit IRC (Ping timeout: 480 seconds)
22:15:47 *** wallabra_ has joined #openttd
22:20:37 *** wallabra has quit IRC (Ping timeout: 480 seconds)
22:21:49 <andythenorth> ok sometimes -j causes a target to attempt to build multiple times when it only needs to build once
22:23:06 <andythenorth> I can see why, but I don't know what to do to prevent it :P
22:27:51 <andythenorth> meh failure is intermittent :D
22:39:43 *** andythenorth has quit IRC (Quit: andythenorth)
23:19:12 *** wallabra has joined #openttd
23:24:07 *** wallabra_ has quit IRC (Ping timeout: 480 seconds)
23:57:30 *** wallabra_ has joined #openttd
continue to next day ⏵