Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to print something in make utility Post 302296061 by radiatejava on Tuesday 10th of March 2009 09:10:17 AM
Old 03-10-2009
How to print something in make utility

Hi want to know the syntax of printing something (value or variable) in GNU make utility. I give this in the Makefile:

echo "Hi"
OR
@echo "Hi"

But I only get error this when I run make (at the line where I have echo):
Makefile:9: *** missing separator. Stop.

Whats the problem? How can I print something ?
 

10 More Discussions You Might Find Interesting

1. Programming

Using make utility to create an mini-app

The following is my makefile. When I run "make", it gives me a bunch of error. I've compiled each file separately and there are no compilation errors. The target is "monprc". Have a look below: monprc: monprc.o monrep.o dsz.o cc -o monprc monprc.o monrep.o dsz.o monprc.o: monprc.c... (1 Reply)
Discussion started by: Yifan_Guo
1 Replies

2. Programming

Make utility

When we run the make utility , make compiles only those files which are undergone changes(other files which have not undergone any changes are not recompiled) The Following quotes says When you run the make utility, it examines the modification times of files and determines what needs to be... (4 Replies)
Discussion started by: victorvvk
4 Replies

3. Programming

MAKE utility

I wrote a makefile, every thing is working fine, But One of the C header files which is created by me is kept in a different folder other than the current directory, I have given this PATH to VPATH Variable Example :- VPATH = /home/user1/projects/victor.h It gives an error as : file... (4 Replies)
Discussion started by: victorvvk
4 Replies

4. Solaris

Make utility

Hi Guys, I m very confused about the make/makefile utility in all unix. 1) My questions is why we need make. 2) Why some source code needs to complile. 3) I download the Bind 9 from Sunfreeware.com. I use pkgadd -d to install the bind. I 'm struck here becasue I can't find /etc/named.conf... (2 Replies)
Discussion started by: bigmoon
2 Replies

5. UNIX for Dummies Questions & Answers

is there kind of good utility that convert make files to dsp?

Hello all im looking for some kind of utility that convert make files to dsp files is there any kind of tool/script that does this job? thanks (1 Reply)
Discussion started by: umen
1 Replies

6. Solaris

Make utility - some Qs togurus..

(Sorry for previous not on enlish! I did not realized it is english forum. ) I am looking for help with Make utility. I could not get help from the 'man' pages. 1. About Macro (as a variable): It is clear about defining any macro in beginning or in command line, but isn't it no way to redefine... (0 Replies)
Discussion started by: alex_5161
0 Replies

7. Programming

Help with a C program that acts like the make utility

Hi, I'm trying to create a C program that functions like the make utility in UNIX for personal use. My program would read in from a generic makefile and execute whatever is in that makefile but I'm not sure as to where I should start coding. I would appreciate any help. Thanks. (1 Reply)
Discussion started by: kratos.
1 Replies

8. Programming

make utility

Hi, Could someone tell me why make utility is mostly preferred for compilation and generating executable in UNIX rather than any user created scripts which contains commands for compilation? (2 Replies)
Discussion started by: naan
2 Replies

9. UNIX for Dummies Questions & Answers

Make Utility Question

Hello, I'm a recent convert to UNIX and I'm attempting to understand exactly how the make utility is working under the hood. Now, I understand that each rule has a target, dependencies, and update command, but the thing I'm confused about is exactly how the utility is determining when to... (1 Reply)
Discussion started by: kramer_102
1 Replies

10. Programming

A make-like build utility based on Lua

xmake is a make-like build utility based on lua. (Link to project site: xmake) The project focuses on making development and building easier and provides many features (.e.g package, install, plugin, macro, action, option, task ...), so that any developer can quickly pick it up and enjoy the... (1 Reply)
Discussion started by: waruqi
1 Replies
Makefile::Parser::GmakeDB(3pm)				User Contributed Perl Documentation			    Makefile::Parser::GmakeDB(3pm)

NAME
Makefile::Parser::GmakeDB - GNU makefile parser using GNU make's database dump VERSION
This document describes Makefile::Parser::GmakeDB 0.215 released on 18 August 2011. SYNOPSIS
use Makefile::Parser::GmakeDB; my $db_listing = `make --print-data-base -pqRrs -f Makefile`; my $ast = Makefile::Parser::GmakeDB->parse($db_listing); DESCRIPTION
This module serves as a parser for GNU makefiles. However, it does not parse user's original makefile directly. Instead it uses Makefile::DOM to parse the "data base output listing" produced by GNU make (via its "--print-data-base" option). So essentially it reuses the C implementation of GNU make. This parser has been tested as a component of the pgmake-db utility and has successfully passed 51% of GNU make 3.81's official test suite. The result of the parser is a makefile AST defined by Makefile::AST. The "data base output listing" generated by "make --print-data-base" is a detailed listing for GNU make's internal data structures, which is essentially the AST used by "make". According to GNU make's current maintainer, Paul Smith, this feature is provided primarily for debugging the user's own makefiles, and it also helps the GNU make developer team to diagnose the flaws in make itself. Incidentally this output is conformed to the GNU makefile syntax, and a lot of important information is provided in the form of makefile comments. Therefore, my GmakeDB parser is able to reuse the Makefile::DOM module to parse this output listing. The data base output from GNU make can be divided into several clearly-separated segments. They're file header, "Variables", "Files", "VPATH Search Paths", as well as the last resource stats information. The contents of these segments are mostly obvious. The Files segment may deserve some explanation. It is the place for explicit rules. Now let's take the Variables segment as an example to demonstrate the format of the data base listing: # Variables # automatic <D = $(patsubst %/,%,$(dir $<)) # automatic ?F = $(notdir $?) # environment DESKTOP_SESSION = default # automatic ?D = $(patsubst %/,%,$(dir $?)) # environment GTK_RC_FILES = /etc/gtk/gtkrc:/home/agentz/.gtkrc-1.2-gnome2 # environment ... It's shown that the flavor and origin of the makefile variables are given in the previous line as comments. Hence feeding this back into GNU make again makes little sense. Similarly, the Files segment for explicit rules also puts big amount of the important information into makefile comments: # Files # Not a target: bar.c: # Implicit rule search has not been done. # Modification time never checked. # File has not been updated. all: foo.o bar.o # Implicit rule search has been done. # File does not exist. # File has not been updated. # variable set hash-table stats: # Load=0/32=0%, Rehash=0, Collisions=0/0=0% foo.o: foo.c # Implicit rule search has not been done. # Implicit/static pattern stem: `foo' # File does not exist. # File has not been updated. # variable set hash-table stats: # Load=0/32=0%, Rehash=0, Collisions=0/0=0% # commands to execute (from `ex2.mk', line 8): $(CC) -c $(CFLAGS) $< -o $@ ... From the previous two data base listing snippets, it's not hard to see that the variable references in rule commands and recursively- expanded variables's values are not expanded. Experiments have shown that GNU make will do implicit rule search for the first rule that needs to, but no more. This behavior means testing our own implicit rule searching algorithm requires specifying at least two goals that require matching. DEPENDENCIES
GNU make 3.81 At least the make executable of GNU make 3.81 is required to work with this module. Makefile::DOM BUGS
o GNU make does not escape meta characters appeared in rule targets and prerequisites in its data base listing. Examples are ":", "", and "#". This bug has been reported to the GNU make team as "Savannah bug #20067". This bug has not yet been fixed on the "make" side, so I have to work around this issue by preprocessing the data base listing in the makesimple script. o The data base listing produced by GNU make lacks the information regarding the "export" and "unexport" directives. It gives rise to the lack of information in the resulting AST structures constructed by this module. Hence the current AST and runtime do not implement the "export" and "unexport" directives. To make it even worse, there's no known way to work around it. I've already reported this issue to the GNU make team as Savannah bug #20069. CODE REPOSITORY
For the very latest version of this script, check out the source from http://github.com/agentzh/makefile-parser-pm <http://github.com/agentzh/makefile-parser-pm>. There is anonymous access to all. AUTHOR
Zhang "agentzh" Yichun "<agentzh@gmail.com>" COPYRIGHT AND LICENSE
Copyright (c) 2005-2008 by Zhang "agentzh" Yichun (agentzh). This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Makefile::AST, Makefile::AST::Evaluator, Makefile::DOM, makesimple, pgmake-db. perl v5.12.4 2011-10-01 Makefile::Parser::GmakeDB(3pm)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy