Coder Social home page Coder Social logo

upmake's Introduction

Upmake

Build Status Coverage Status

Pragmatic way to manage build system for cross-platform applications: update the lists of source and header files in all the make and project files at once.

Installation

Upmake is a Perl module with no non-core dependencies and can be installed by running the following commands:

perl Makefile.PL
make install

It can also be installed from CPAN in the usual way.

Alternatively, you can download a single file containing the latest version of the command line script with all its dependencies, but this won't allow you to use its functionality programmatically which is usually required for non-trivial projects. Notice that you still need to have Perl (5.10+) to run this file.

Usage

For the simplest possible case, e.g. if starting a new project, create the master files list files with the following contents:

# Comments are allowed, everything else should consist of variable
# definitions in the very simple format below:
sources =
	first_source_file.cpp
	another_source_file.cpp
	and_so_on.cpp

headers =
	first_header.hpp
	last_header.hpp

If you use a makefile for building your project under Unix systems, define the variable called either sources or objects in it, e.g.

# GNUmakefile
objects := \
		first_source_file.o

Running

upmake GNUmakefile

will now update GNUmakefile to contain all the files from the master list (with the correct .o extension).

Of course, this is not any better than just maintaining the list of files in the makefile directly, but the advantage of upmake is that you can also update MSVC project files from the same master list, just do

upmake my.vcxproj # or .vcproj for older versions

If you don't have committed or backed up versions of the files, it is strongly recommended to use --dry-run --verbose options to check that the modifications conform to your expectations before actually making them.

Generally speaking, any variables or targets defined in the makefile will be updated with the values of the variables with the corresponding names from the master file (and if there is no corresponding variable, nothing is done). As for project files, variables proj_sources, proj and sources where proj is the base name of the project are used by default in this order, i.e. the first one found is used (for the headers, only proj_headers and headers are checked).

A common situation is that an existing makefile uses several variables, e.g. sources_foo and sources_bar, while a single variable containing all the sources is needed for the project file. This can be resolved by defining such variable in terms of other existing ones:

proj_sources =
	$sources_foo
	$sources_bar

For yet more complicated cases you may use the module programmatically, see e.g. this example.

Licence

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Terms of the Perl programming language system itself

  • the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
  • the "Artistic License"

upmake's People

Contributors

vadz avatar manwar avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

manwar

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.