Sponsored Content
Top Forums Programming Simple Makefile Problem (with a dependency) Post 302284691 by spirtle on Friday 6th of February 2009 06:13:00 AM
Old 02-06-2009
You need to think about what the chain of dependencies really are:

The executable Code1 depends on the object files Code1.o and Tools.o
The object file Code1.o depends on the source files Code1.cpp and Tools.hh and the makefile
The object file Tools.o depends on the source files Tools.cpp and Tools.hh and the makefile.

So a simple makefile could be something like
Code:
%.o: %.c Tools.hh makefile

Code1: Code1.o Tools.o
Code2: Code2.o Tools.o
Code3: Code3.o Tools.o

This uses
- a pattern rule to say that any .o depends on the corresponding .cpp and the header and the makefile
- rules to say that Code1 depends on Code1.o and Tools.o
- implicit rules to do the compilation and linking (make knows it needs to use g++ to compile, and so on)

If you want to specify the compilation or linking rules yourself, then you have to specify the complete command. You had
Code:
Code3: $(TOOLSRC) $(TOOLSINC) makefile
                $(CXX)

where your rule is just "g++" with no arguments. That's like typing just g++ on the command line, hence the error message, You need to have the same thing as you would type on the command line, e.g.
Code:
        $(CXX) Code3.o Tools.o -o Code3

or if you want to be fancy and more general with automatic variables
Code:
        $(CXX) $^ -o $@

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

problem with Makefile

Hi, I have a makefile which looks like this ProcessA : commands touch pro1 ProcessB : pro1 commands touch pro2 ProcessC: pro3 commands and after some runs, i wish only pro3 to run and I check that "pro1" and "pro2" are there in the directory, but still, if i give make... (3 Replies)
Discussion started by: sskb
3 Replies

2. Programming

Makefile very simple question.

Hi I tried many times and I dont know what the he... is going on. Problem: I hava in /home/marcin/c1_menu/ this file: menu_item_data.c I want to compile this file. so I tried something like this CC=gcc LIBS=-lmenu -lncurses RM=rm BINS=menu_item_data %: %.o ${CC} -o $@... (1 Reply)
Discussion started by: marcintom
1 Replies

3. Programming

Problem with a Makefile

Hi, I am very new with makefile topics , maybe this is a very symple question... I have this code wich compile very good ( I get it from the net), I will call it code A. I have to add it with a program that is all ready in use, (code B) that also compile good. When I put together it doesnt... (7 Replies)
Discussion started by: pmoren
7 Replies

4. Solaris

Dependency problem

Hi all am new to solaris ............ i installed amanda client pkg that time am getting lots of dependency problem.......... is there any Yum server like things in solaris Regards ' prAn (8 Replies)
Discussion started by: pran
8 Replies

5. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

6. Infrastructure Monitoring

Weird dependency problem!

Hi, I want to install net-snmp-devel package but i have following dependecy problem. It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S Could you help me please? Here are the steps: # ls -l total... (4 Replies)
Discussion started by: oduth
4 Replies

7. Programming

Problem with Makefile

Hi, Here is my makefile http://pastie.org/1104332. I am trying to compile different .c files and .s files (assembly files) from different sub directories into E:/em35x/build/mfg-sample-app-cortexm3-iar-em357-em3xx-dev0680/ then the linker should link all the .o files from the build directory... (1 Reply)
Discussion started by: blade2008
1 Replies

8. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

9. Emergency UNIX and Linux Support

Problem With Makefile

I had created a Makefile for my project. my project file hierarchy is like this: 1. a source folder with main.c and Makefile in it 2. and a top level Makefile here is the Makefile in src folder all: program program: main.c gcc -o program main.c clean: rm programand here is top... (3 Replies)
Discussion started by: majid.merkava
3 Replies

10. Shell Programming and Scripting

Simple Makefile for LaTeX

I create figures using Gnuplot, but I use terminal epslatex, which produces a .tex file as output. I then latex this .tex file which creates are .dvi file, which I then convert to .ps and finally to an .eps file. Anyway here's what I'm doing in steps gnuplot plot.gplt (this writes out... (2 Replies)
Discussion started by: lost.identity
2 Replies
Bio::Tools::SiRNA::Ruleset::saigo(3pm)			User Contributed Perl Documentation		    Bio::Tools::SiRNA::Ruleset::saigo(3pm)

NAME
Bio::Tools::SiRNA::Ruleset::saigo - Perl object implementing the Saigo group's rules for designing small inhibitory RNAs SYNOPSIS
Do not use this module directly. Instead, use Bio::Tools::SiRNA and specify the saigo ruleset: use Bio::Tools::SiRNA; my $sirna_designer = Bio::Tools::SiRNA->new( -target => $bio_seq, -rules => 'saigo' ); my @pairs = $sirna_designer->design; foreach $pair (@pairs) { my $sense_oligo_sequence = $pair->sense->seq; my $antisense_oligo_sequence = $pair->antisense->seq; # print out results print join (" ", $pair->start, $pair->end, $pair->rank, $sense_oligo_sequence, $antisense_oligo_sequence), " "; } DESCRIPTION
This package implements the rules for designing siRNA reagents published by Ui-Tei et al(2004). The rules are: 1. The first base in the sense strand of the duplex must be a G or C 2. The first base in the antisense strand of the duplex must be an A or U 3. The first 7 nucleotides in the antisense strand of the duplex must be A or U 4. There cannot be more than 9 consecutive G or C nucleotides 5. The first 12 nucleotides in the sense strand of the duplex should have 33-66% GC The module inherits from Bio::Tools::SiRNA. See the documentation for that module for information on how to specify the target and recover the SiRNA duplex information. EXPORT None. SEE ALSO
Bio::Tools::SiRNA, Bio::SeqFeature::SiRNA::Pair, Bio::SeqFeature::SiRNA::Oligo. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR
Donald Jackson (donald.jackson@bms.com) APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : Do not call directly - use Bio::Tools::SiRNA->new instead. Returns : Bio::Tools::SiRNA::Ruleset::saigo object Args : none perl v5.14.2 2012-03-02 Bio::Tools::SiRNA::Ruleset::saigo(3pm)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy