Giter Club home page Giter Club logo

hashmake's Introduction

A Hack to Make 'make' Work Better!

This is a simple implementation of build logging or accumulative build methodology (I'm not quite sure which describes it best).
I have heard some confusion with ccache, but ccache is implemented on the lower level and is language specific.

The idea is to check upon whether contents of a file and the compilation flags has changed from one run to another.

It appear to be not too difficult to do in a simple makefile, rather then trying to reinvent the wheel in a different language!

Notes:

So far it's a very immature project, but once I'm done with the testing I hope it will be useful to many users!

I need to consider renaming it, perhaps, because there exists a command in Solaris with the same name.
However this is not a command, but only a makefile template. Of course it may be turned into one somewhat.

Motivation

I needed a way of storing all build output for one of my hardware design (read: Verilog) projects and one of the problem that I faced with
make was forcing remake when flags for the preprocessor have changed and yet I wanted to store outputs for each of run.

This however doesn't mean that the hashmake template is Verilog-specific. One may wish to use it for build logging purposes or any other
imaginable paradigm. Of course, in many cases, some consideration needs to be taken whether a revision control system may be more appropriate.

Future Work

  • Testing
    • testing with different projects
  • Reusability
    • generalisation of code to make it usable as a part of existing code (plugged into real-world makefiles)
    • attempt to fit around autotools
      A simple solution would be to just add 'move-build' target if you just need to store the builds, but that doesn't help to
      solve checks on preprocessor flags, which needs to be done much earlier!
  • Scripts
    • find builds made with specific flags
    • run or view specific builds
    • integrate with revision control tools (i.e. grep for git commit id)
      There is no use for taking care of what the commit/revision id is when building the code, since that doesn't explicitly mean
      that the particular file was changed. However it would be usefull to be able to find a build made in between specific commits
      to the repository or, in other words, builds which had been made on a given code revision.

hashmake's People

Contributors

errordeveloper avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hashmake's Issues

Cross-platform SHA command

It appears that quite a few Linux distributions are still using OpenSSL 0.9.x, while some other systems (e.g. Mac OS X) already
use 1.0.x. There is a issue with SHA algorithms which these versions implement - 0.9.x doesn't have SHA-256, perhaps SHA-1
fits the purpose quite well and git uses it too.

There is another issue with two versions of OpenSSL:

  • with v0.9.x:
    • the output of printf "Test\n" | openssl sha1 is just a hash string
  • with v1.0.x:
    • the output of printf "Test\n" | openssl sha1 is prefixed with (stdin)= and a white space.

However, it turns out that | cut -d" " -f2 outputs the hash string in any case.

A good alternative is to use shasum command, which seems to be distributed as part of Perl distribution.

The issue with sha1sum from GNU coreutils, is that it isn't pre-installed on systems other then Linux.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.