Page 1 of 1

src/Makefile bugs and fixes

Posted: October 20th, 2009, 8:29 pm
by maqifrnswa
Hello, I've been packaging Sandbox for inclusion in Debian non-free and redistribution in other distributions such as Ubuntu and Edubuntu. This is a very nifty piece of software I've enjoyed playing with while working on it! I've come across some src/Makefile bugs which could be easily fixed:

The first is a typo in the target clean:

Code: Select all

-$(RM) $(SERVER_OBJS) $(CLIENT_PCH) $(CLIENT_OBJS) $(SSPCLIENT_OBJS) $(FPSCLIENT_OBJS) $(LAUNCHER_OBJS) $(MASTER_OBJS) $(PLATFORM_PREFIX)_server_* $(PLATFORM_PREFIX)_client_*
is missing $(RPGCLIENT_OBJS) it should be:

Code: Select all

-$(RM) $(SERVER_OBJS) $(CLIENT_PCH) $(CLIENT_OBJS) $(SSPCLIENT_OBJS) $(FPSCLIENT_OBJS) $(RPGCLIENT_OBJS) $(LAUNCHER_OBJS) $(MASTER_OBJS) $(PLATFORM_PREFIX)_server_* $(PLATFORM_PREFIX)_client_*


In all the enet targets you are not using Autotools but instead generating your own configure file. I think you should add autotools to the list of things the build depends on and let the src/Makefile make enet's build configurations using autotools (this is useful for letting more architectures use the program). To do that, you can change the following targets in src/Makefile:

Code: Select all

clean-enet: enet/Makefile
	$(MAKE) -C enet/ clean
should be changed to:

Code: Select all

clean-enet:
	[ ! -f enet/Makefile ] || $(MAKE) -C enet clean
	rm -f enet/config.guess enet/config.log enet/config.sub
	rm -f enet/configure enet/config.status
	rm -f enet/Makefile enet/include/Makefile enet/include/enet/Makefile
	rm -f enet/Makefile.in enet/include/Makefile.in
	rm -f enet/aclocal.m4 enet/enet.dsp
	-rm -r enet/autom4te.cache
	-rm enet/include/enet/Makefile.in
	-rm -r enet/.deps

and the following target should be changed:

Code: Select all

enet/Makefile:
	cd enet; ./configure
to:

Code: Select all

enet/Makefile:
	cd enet; aclocal && automake -a -c --foreign && autoconf
	cd enet; ./configure

and then your clean target could now be even "cleaner!" by adding "clean-enet" as the prerequesit to the clean target:

Code: Select all

clean: clean-enet
	-$(RM) $(SERVER_OBJS) $(CLIENT_PCH) $(CLIENT_OBJS) $(SSPCLIENT_OBJS) $(FPSCLIENT_OBJS) $(RPGCLIENT_OBJS) $(LAUNCHER_OBJS) $(MASTER_OBJS) $(PLATFORM_PREFIX)_server_* $(PLATFORM_PREFIX)_client_*

If you have any other questions, PM me

Re: src/Makefile bugs and fixes

Posted: October 20th, 2009, 10:54 pm
by Hirato
thanks for pointing out the typo at the top
I'll pass the notes on enet over to Lee, no guarantees that anything will happen on that front

Re: src/Makefile bugs and fixes

Posted: October 20th, 2009, 11:05 pm
by maqifrnswa
Thanks - no problem, I understand it's a complicated issue with the number of platforms you support.

Re: src/Makefile bugs and fixes

Posted: October 21st, 2009, 10:23 am
by Obsidian
I've tossed this into the bug tracker so that the nub team...err, I mean, developers can keep track of this. Tracker ticket that was opened is here: tracker.php?p=3&t=26

I expect to hear Hirato complaining to me about him receiving emails from the tracker any time now. :lol: