Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » The power of Makefile
Re: The power of Makefile [message #25896 is a reply to message #25892] Thu, 18 March 2010 10:57 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Honza,

thanks for your effort!
I will test it on BSDs as soon as possible.

Matthias
Re: The power of Makefile [message #25915 is a reply to message #25896] Fri, 19 March 2010 17:53 Go to previous messageGo to next message
Reini is currently offline  Reini
Messages: 28
Registered: April 2009
Location: Berlin
Promising Member
Hello Guys,

I would like to give some Feedback about the Makefile from OSX.
There is a parsing error in the script on my machine.

sh-3.2# make -f Makefile PKG=ide "FLAGS=GUI SSE2 MT SPEED" FAST=n BIN=bin EXPORT=Makefile.ide
Parsing package ide ...
sed: 2: "1h;1!H;${ g;s/;[\t \x0A ...": RE error: parentheses not balanced
  Preparing output directory structure ...
usage: mkdir [-pv] [-m mode] directory ...
make: *** [prep-dirs] Error 64


My personal opinion is to move away from this complicated oldschool make stuff to premake build system since its also very small and much more easier to maintain !

Greeting Reinhold
Re: The power of Makefile [message #25937 is a reply to message #25915] Sat, 20 March 2010 22:48 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Reini wrote on Fri, 19 March 2010 17:53

Hello Guys,

I would like to give some Feedback about the Makefile from OSX.
There is a parsing error in the script on my machine.

sh-3.2# make -f Makefile PKG=ide "FLAGS=GUI SSE2 MT SPEED" FAST=n BIN=bin EXPORT=Makefile.ide
Parsing package ide ...
sed: 2: "1h;1!H;${ g;s/;[\t \x0A ...": RE error: parentheses not balanced
  Preparing output directory structure ...
usage: mkdir [-pv] [-m mode] directory ...
make: *** [prep-dirs] Error 64


My personal opinion is to move away from this complicated oldschool make stuff to premake build system since its also very small and much more easier to maintain !

Greeting Reinhold


Hi Reini,
Thank you very much for feedback. I'll have a look at it soon. Looks like it is just different syntax of mkdir on mac... I don't have any mac around, so I'll probably contact you soon via PM for frther testing, hope you don't mind that Wink

It is not very complicated, and since it was never tested on mac (just linux and BSD), it doesn't even surprise me, that there is a problem... And do you really think premake/cmake/scons etc. are any simpler? Smile

Regards,
Honza
Re: The power of Makefile [message #25962 is a reply to message #25937] Mon, 22 March 2010 11:05 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Honza,

unfortunately, the same error occurs on BSDs with the latest version.
This is rather an issue with sed than with mkdir since mkdir just complains about missing arguments which is a result of sed parsing error.

Regards,
Matthias
Re: The power of Makefile [message #25972 is a reply to message #24947] Mon, 22 March 2010 20:32 Go to previous messageGo to next message
Reini is currently offline  Reini
Messages: 28
Registered: April 2009
Location: Berlin
Promising Member
Hello Honza,

Thanks for the comments Smile

In fact I think that one of the mentioned build systems is in the end easier to maintain for all platforms. They can generate project files for all commonly widespreaded IDEs out there and simplify a lot. Also for the acceptance of UPP it would help improve a lot.

For example to integrate an external lib is just some commands and to update to a newer revision also. UPP has at the moment just hard linked sources to libpng which I assume have not updated since several months. I see this since I got a lot of warnings when compiling the sources.

I try to do a version with premake and give you feedback how far I progress Rolling Eyes

cYa
Re: The power of Makefile [message #25985 is a reply to message #25972] Tue, 23 March 2010 10:45 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Reini,

I favor the use of old-fashioned Makefile, because you can use gmake that has quite a small footprint compared to other make systems that have dependencies and may require, e.g. Python (I think SCons is programmed in Python).

Admittedly, the version we have now is not easy to read, so maintenance is a point, here. But I suppose Honza will be there to support it.

It was the goal for our Makefile to take *.upp files as the basis for generating the dependencies and get all options available inside these project files. So essentially all U++ projects can be build exactly in the way TheIDE would build them (except for Blitz) and if you change some options inside your project it will be automatically taken into account by the Makefile the next time you run it.
So you even do not have to write extra commands to include changes Smile!

Matthias
Re: The power of Makefile [message #25987 is a reply to message #24947] Tue, 23 March 2010 12:10 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi,

The summary from Matthias is very accurate. I would like to just add that the initial idea was to get theide-like possibilities even on systems where theide is not installed, mainly to make export and distribution of apps easier.

Reini, no one is going to stop you if you try implement this with premake or any other build system. Actually opposite is true - the more possibilities we offer, the more users should be happy because they find something the are familiar with.

BTW: There was attempt to use cmake to build u++ (by Sender Ghost), but AFAIK it was not succesful (yet) because of some problems with icpp files handling. Similar problems might arise with premake.

Best regards,
Honza
Universal Makefile [message #28331 is a reply to message #24947] Sat, 28 August 2010 00:30 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi everyone,

Even though it might looked like the development of the beast I personally call universal Makefile have ceased, the opposite is truth. I gave it a major rewrite, keeping the same idea and mostly same syntax, but writing brand new internals, especially the parser.

So what is new: It supports a wider selection of systems, I took care especially to make sure it works on BSD (using gmake), and that should make it work on most other POSIX compliant systems too. Also it doesn't require bash now, plain sh will suffice (or ash, dash, etc.). Some changes also happened to the parallel building, it now uses the number of cpus as a number of threads by default. The output is IMHO prettier and more informative now. The internals are also written with maintainability in mind that should save me some hair pulling in future Smile

Anyone interested can find the new version in uppbox/lpbuild in svn or on-line here: http://code.google.com/p/upp-mirror/source/browse/trunk/uppb ox/lpbuild/Makefile

Best regards,
Honza
Re: Universal Makefile [message #28332 is a reply to message #28331] Sat, 28 August 2010 09:22 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
Awesome.

A small bug: I'd like to use the "export" feature, using that syntax (my locale is fr_FR.UTF-8):
$ make -f uppbox/lpbuild/Makefile PKG=ide FLAGS="GUI MT" export
  Exporting uppbox/lpbuild/Makefile to Makefile.export ...
make[1]: [ide] Erreur 1 (ignorée)
$ cat Makefile.export
.PHONY:default
default: all
$

What? That's all? Seems it's missing some content. Next I try to use the C locale:

$ export LC_ALL=C
$ make -f uppbox/lpbuild/Makefile PKG=ide FLAGS="GUI MT" export
  Exporting uppbox/lpbuild/Makefile to Makefile.export ...
make[1]: [ide] Error 1 (ignored)
$ cat Makefile.export
[whole content, so it works]


So I suggest the subprocesses are executed with the locale set to C, so that words parsing later works.

UPDATE: I also changed one line for more precise output, so that you understand why yours may differ: line 337, I changed
    $(call echo,"  Exporting makefile to $(EXPORT) ...")
to
    $(call echo,"  Exporting $(filename) to $(EXPORT) ...")


regards,
Lionel

[Updated on: Sat, 28 August 2010 09:26]

Report message to a moderator

Re: Universal Makefile [message #28405 is a reply to message #28332] Tue, 31 August 2010 19:37 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Lionel,

It took bit longer than I expected, I found few more bugs in the process of fixing this one Wink And the problem actually was not related to the locale, at least I think...

Here I post fixed version, please let me know if it works better.

Best regards,
Honza
  • Attachment: Makefile
    (Size: 23.35KB, Downloaded 386 times)
Re: Universal Makefile [message #29913 is a reply to message #28405] Mon, 29 November 2010 20:57 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Honza,

really good work !
Now, I did find time to test your Makefile.

One thing I observed is that with every make call *.cpp files are always recompiled even if there exists an object file with a newer time stamp.
I tested this on different OSs (Ubuntu, CentOS, FreeBSD) and on machines having either a single or two CPUs and always got the same behavior.
The command line was:

make PKG=ide FLAGS="NOGTK GUI" USEMAINCFG=y BINPREFIX=~/bin/

I expect to only get a recompilation if source file is newer than compiled object file (at least that is what classic make tool checks for).

Regards,
Matthias
Re: Universal Makefile [message #29915 is a reply to message #29913] Mon, 29 November 2010 21:31 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

masu wrote on Mon, 29 November 2010 20:57

One thing I observed is that with every make call *.cpp files are always recompiled even if there exists an object file with a newer time stamp.

Oops, looks like I broke something Embarassed It is of course supposed to rebuild only when the source has newer timestamp. I'll look into it...

Thanks for testing, Matthias!

Honza
Re: Universal Makefile [message #29917 is a reply to message #29915] Mon, 29 November 2010 23:33 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Honza, sorry, but another thing:

Flags in *.upp files labeled "BSD" are not taken into account on BSD systems. BSD variants have these flags in common.

Regards,
Matthias

Previous Topic: Anybody still knowing anyone using Win98?
Next Topic: What do you think I should do?
Goto Forum:
  


Current Time: Thu Mar 28 17:27:23 CET 2024

Total time taken to generate the page: 0.01674 seconds