Panotools::Makefile man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Panotools::Makefile(3)User Contributed Perl DocumentatioPanotools::Makefile(3)

NAME
       Panotools::Makefile - Makefile creation

SYNOPSIS
       Simple object interface for generating Makefiles

DESCRIPTION
       Writing Makefiles directly from perl scripts with print and "\t" etc...
       is prone to error, this library provides a simple perl interface for
       assembling Makefiles.

       Note GNU make syntax is assumed, i.e. on BSD systems where pmake is the
       default you will have to switch to gmake if you want to work with
       weirdly named targets containing special characters such as spaces or
       parentheses.

USAGE
	 use Panotools::Makefile;

       Create a new Makefile object:

	 my $makefile = new Panotools::Makefile;

       Start adding items to the Makefile:

       Rule() returns a new Panotools::Makefile::Rule object, Variable()
       returns a new Panotools::Makefile::Variable object and Comment()
       returns a new Panotools::Makefile::Comment object:

	 my $var_user = $makefile->Variable ('USER');
	 $var_user->Values ("Dr. Largio d'Apalansius (MB)");

	 my $rule_all = $makefile->Rule ('all');
	 $rule_all->Command ('echo', '$(USER_SHELL)', '>', 'My File.txt');

	 $makefile->Comment ('.PHONY target isn't strictly necessary in this case');
	 my $rule_phony = $makefile->Rule;
	 $rule_phony->Targets ('.PHONY');
	 $rule_phony->Prerequisites ('all');

       Assemble all this into string that can be written to a Makefile:

	 my $string = $makefile->Assemble;

       ..or write the Makefile:

	 $makefile->Write ('/path/to/Makefile');

       ..or let the module execute rules with 'make' directly:

	 $makefile->DoIt ('all') || warn "Didn't work :-(";

       The following command will be executed, something that isn't possible
       with perl system() or exec(), and would otherwise require careful
       assembly with backticks:

	 echo Dr.\ Largio\ d\'Apalansius\ \(MB\) > My\ File.txt

       On the Windows platform you get appropriate quoting:

	 echo "Dr. Largio d'Apalansius (MB)" > "My File.txt"

perl v5.14.1			  2010-04-16		Panotools::Makefile(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net