This is a Makefile patch which eliminates some annoying behavior which causes my tree to continually differ from upstream.
Previously makeobj/Makefile had to be edited directly to set the ostype.
Now it uses config.default from the parent directory.
While you are at it: Now makeobj and simutrans requires log.cc to be compiled differently. debug_t::fatal(..) compiles differently with/without graphics. Maybe you know a Makefile trick to generate two different log.o's ? One for simutrans, one for makeobj.
Actually, for BeOS, I have to use the Linux switch ... The makeobj makefile was never updated to the system simutrans uses. This would make most sense imho.
For the problem in question I would jsut suggest to delete log.o after linking makeobj always.
Well, I actually do. It's totally straightforward if you think about it -- just build a different object file from the .c file, and link that one instead of log.o:
makeobj-log.o: log.cc
$(CXX) $(CXXFLAGS) -DMAKEOBJ -o $@ -c $<
(I probably didn't get the directories or other details right there, of course.)
EDIT: it gets messy in the presence of automatic dependency generation, however.
Note that simtools.o is different in MAKEOBJ too.
Interesting, why? The only difference (in makeobj) is that -lm is linked with the Linux switch. This could be added to the BeOS configuration, no problem.
You are right about BeOS. Aparently I changed this once and just kept it that way.
Aaaand, here's the revised, dramatic patch which reconstructs the entire makeobj build to use a very similar system to the simutrans build.
I had to make an altered version of common.mk, hence "uncommon.mk".
Works on Linux. If it's broken anywhere else it should work with minor CXXFLAGS or STD_LIBS changes.
Well, order of libraries under mingw must be exactly in this order in the makefile but otherwise worked fine.
By the way, now makeobj is 20 kB larger, might be the new compiler settings ...
Oh, probably that's the change in optimization settings. If we care about size we should use -Os instead of -O2.
The commit to SVN seems to have lost the file makeobj/uncommon.mk
The patch will not work without it; please commit.
Extra copy attached (zipped).