Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace build script with Makefile #52

Open
juditacs opened this issue Mar 27, 2016 · 5 comments
Open

Replace build script with Makefile #52

juditacs opened this issue Mar 27, 2016 · 5 comments

Comments

@juditacs
Copy link
Owner

This would be a very nice addition.

@NobbZ
Copy link
Contributor

NobbZ commented Mar 27, 2016

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.

@juditacs
Copy link
Owner Author

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.

@NobbZ
Copy link
Contributor

NobbZ commented Mar 27, 2016

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 runs true if scripted
  • run: Runs the program. If you add this rule, you can get rid of the run_commands completely.
  • 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

@NobbZ
Copy link
Contributor

NobbZ commented Mar 29, 2016

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.

@juditacs
Copy link
Owner Author

Not at all. Go ahead please, it would help a lot.

@NobbZ NobbZ mentioned this issue Mar 29, 2016
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants