Replace build script with Makefile
This would be a very nice addition.
Do you want a huge monolithic Makefile to rule them all or a master Makefile which recursively calls another languages Makefile?
If the latter you should probably define a list of targets that are used as API.
I'm leaning towards one monolithic Makefile (it wouldn't be that long, less than half of the solutions need compiling), but I'm open to suggestions.
I'm not only concerned about compiling, but also running and cleaning.
A monolithic file which holds everything would grow into an unmaintainable state as the count of implementing languages grow.
A recursive Makefile, which does simply run some predefined targets on every Makefile in every folder except for data and scripts can be created once and might never get touched from then on. Additionally one can use all the Makefile-magic one knows in the languages Makefile without messing up with the monolith. This also means less merge-conflicts when there are several PRs open that want to add a new implementation.
As a quickshot I'd go for a language-Makefile with the following targets:
-
build: Builds if necessary, just runstrueif scripted -
run: Runs the program. If you add this rule, you can get rid of therun_commandscompletely. -
clean: You should never have a Makefile without this rule ;)
Looking at those, you can also provide some small Makefile.template which would be sufficient for most scripted languages and only the run-target needs to get changed, compiled languages need to alter a little bit more, but most of their programmers will know what to do exactly, since most is just forwarding to some languages build tool.
# For scripted languages it might be unnecessary to change anything except the line below `run:`
# Please keep in mind, that whatever you do, <TAB> characters need to stay intact!
build:
true # commands to create your binary/executable
clean:
true # commands to clean buildartifacts
rebuild: clean build
run:
./wordcount # command to start your version
If you don't mind, I'd like to give it a shot during the next couple of days along with another idea I have regarding contributors.
Not at all. Go ahead please, it would help a lot.