b.zaar wrote:It would only configure when you ran
(using the new working title) otherwise it goes through the usual build process.
You're going to want to cache that data as well somehow.
b.zaar wrote:Could this be done inside an include.mk file without it needing to be separate?
Now, you'd have 3 or more files to keep track of; the Planfile, the cache, and a .mk for each plan. In my idea, there are no separate files. You only need to write a Planfile. When you call 'plan', it'll apply the configuration and strip the Planfile down to create a Makefile.
b.zaar wrote:Is this run manually like
or it will automatically detect it needs the build?
It's just adding 1 more step to the build process:
You would only need to run 'plan' if you added new sources to the project. If we wanted to automatically do this, one idea would probably be to add the Planfile itself as a target rule within the Makefile. This way, if the timestamp of the Planfile changes, it'll automatically re-plan itself.
b.zaar wrote:Couldn't this be a dependant for the target that relies on it and only build then?
That's what I was talking about in the 3rd reason I chose to use a separate file. The developer could distribute a generic Makefile alongside the Planfile. If the person has 'plan' installed, calling it would overwrite the Makefile. Otherwise, they'll fallback on the generic Makefile. This would also greatly help ease the transition into the use of Planfiles.
b.zaar wrote:Sub modules and tools directories would just be the first dependencies. I was already using this in make to build a disk image writer tool along with making the kernel and then using the tool to build the disk image all in 1 build process.
What is your example for this and do you need to run make more than once to completely build everything?
Nope, you can do it all in 1 go. I haven't worked out all the details yet, but my idea was more or less along the lines where adding a '&' prefix to a target would declare a plan and adding a '^' prefix would declare a step. Something like:
Code: Select all
&MyPlan: MyStep1 MyStep2
@echo MyPlan built successfully
^MyStep1:
@echo step 1
^MyStep2:
@echo step 2
Would be expanded into something like:
Code: Select all
PLANS = MyPlan
MyPlan_STEPS = MyStep1 MyStep2
all: $(addprefix all-,$(PLANS))
build: $(addprefix build-,$(PLANS))
all-MyPlan: build-MyPlan
build-MyPlan: $(addprefix --MyPlan-,$(MyPlan_STEPS))
@echo MyPlan built successfully
--MyPlan-MyStep1:
@echo step 1
--MyPlan-MyStep2:
@echo step 2
b.zaar wrote:What do you do for an unexpected platform that doesn't have a pre configured makefile or plan installed?
It's the developers choice as to whether or not they want to exclude a generic Makefile and enforce the use of Planfiles.
b.zaar wrote:You've just created another autotools using a different language.
That's pretty much the idea. I want the flexibility of autotools, without the bs that comes with it.