Hello, and thank you all for your help!
I have just taken a sneak peak into the Makefile that PHP generates when configured with the --disable-all switch - which really, disables pretty much everything except the pure core. Reading this up and down tells me that it is not very hard to convert a Makefile. In fact, I have it half-way converted using simple RegExp search and replace pattern. These may just need outlining. Reading a little further, I found how the files in a Makefile are structured:
ext/pcre/pcrelib/pcre_refcount.lo: /Users/Ingwie/Work/drag0n-php/ext/pcre/pcrelib/pcre_refcount.c
$(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H -I/Users/Ingwie/Work/drag0n-php/ext/pcre/pcrelib -Iext/pcre/ -I/Users/Ingwie/Work/drag0n-php/ext/pcre/ $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /Users/Ingwie/Work/drag0n-php/ext/pcre/pcrelib/pcre_refcount.c -o ext/pcre/pcrelib/pcre_refcount.lo
Looking at this told me, that just two simple words, and a re-wrap, is missing. And that made me get closer to the idea of having a script that actually parses lines like these - and makes them change to simething like this:
CC = clang
CFLAGS = ...
# snip...
LIBTOOL_CC_FLAGS = -DHAVE_CONFIG -H
rule LIBTOOL_CC
command $LIBTOOL --mode=compile $CC $LIBTOOL_CC_FLAGS $INCLUDES $COMMON_FLAGS $CFLAGS_CLEAN $EXTRA_CFLAGS -c $in -o $out
build ext/pcre/pcrelib/pcre_refcount.lo: LIBTOOL_CC /Users/Ingwie/Work/drag0n-php/ext/pcre/pcrelib/pcre_refcount.c
Now, we can use a generator (such as the one I am coding rightnow) to change CC and alike - actually, we could use the include statement. But what I want to point out here, is that we're only moving around some parts. One can easily get said parts using things like <?php $strArr = explode(" ",'$LIBTOOL --mode=compile ...'); ?> and then we'd have to iterate over it.
I think I finally found my solution here - and I think I can actually just convert the makefile. What will be harder however, arte the targets - such as:
all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@echo
Does anybody have a suggestion how I may handle the @ statements? Can I actually have multiple command entries in a build block? Like:
build foo: bar
command = cmd1
command = cmd2
That way, I could just convert the @ into a command = output.
Any suggestion is helpful. For now, I am going to start on the direct Makefile converter. Let's see where we get!
Also, I looked into the cmake thing. It apepars to me that the cmake thing is sort of broken. I will investigate further - maybe I am just missing something out o.o
Thanks again for all your feedback! ^_^
Kind regards, Ingwie