Sponsored Content
Top Forums Shell Programming and Scripting Building programs from separate makefiles Post 302759501 by kristinu on Tuesday 22nd of January 2013 11:32:46 AM
Old 01-22-2013
What I did was to have only one makefile for each application and store them in a single folder. Then the main Makefile will execute the appropriate Makefile

I think I have a solution. Let me try it and will report back.

---------- Post updated at 11:32 AM ---------- Previous update was at 11:26 AM ----------

I am rewriting them.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Combining makefiles

I have concatenated 2 makefiles, to produce 1 however it is not running all of the code, producing a fatal error: symbol referencing errors. No output written. Can anybody please help? (4 Replies)
Discussion started by: Dan Rooney
4 Replies

2. UNIX for Dummies Questions & Answers

makefiles in a directory and subdirectories

I need to develop a makefile that spans across directories. For example, let's say i have an upper level directory (main) and about 2 subdirectories. I want my .cpp files and .o files to be in one subdirectory. I want my .a files to be in the other subdirectory. The .a files are made up of the... (0 Replies)
Discussion started by: benjie_asu
0 Replies

3. Shell Programming and Scripting

How can I print variables im using in makefiles?

for example in my make file im building path from env variables and string but need to see what is did what is the best way to print the result? say I have in my Makefile : exec_prefix = $(RUN_ENV_LOCAL)/apache and I will like to print the exec_prefix value , how can it be done ? (1 Reply)
Discussion started by: umen
1 Replies

4. UNIX for Advanced & Expert Users

makefiles

Solved........ (0 Replies)
Discussion started by: klam
0 Replies

5. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

6. Programming

Makefiles for different programs

I have several programs in several directories and want to use make to build the executables. What I have done is to put the main programs in their own directory together with a makefile to build the program. Then I am thinking of having another makefile residing in the directory above so I can run... (1 Reply)
Discussion started by: kristinu
1 Replies

7. Programming

Makefile for building multiple programs

I have the following part of a makefile and want to simplify it using rules rather than having to code the same two blocks when I need ti build another program. An having difficulty doing it all: 1dvel2 1dvel 2dvel ... (8 Replies)
Discussion started by: kristinu
8 Replies

8. Programming

First time programmer needs Help with Makefiles

I am trying to practice to create Makefiles. The goal is to create a makefile such that if a change is made to any of the source code files, the project can be rebuilt by typing make at the command line. I have the following files: ac.cc: has include ac.h and pg.h fr.cc: has main... (8 Replies)
Discussion started by: pintu1228
8 Replies

9. UNIX for Dummies Questions & Answers

Difference between inbuilt suid programs and user defined root suid programs under bash shell?

Hey guys, Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries. However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies

10. UNIX for Beginners Questions & Answers

Makefiles

Hi All, I was going through some makefiles where I saw occurrences of explib_subdirs and expinc_subdirs, which I could not understand. Exporting libs to subdirs ? Exporting include files to specified subdirs ? When do we need to do that ? What I could understand is, for a build, I would... (4 Replies)
Discussion started by: alltaken
4 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 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy