Sponsored Content
Top Forums Programming Simple Makefile Problem (with a dependency) Post 302284317 by monkfan on Thursday 5th of February 2009 09:37:11 AM
Old 02-05-2009
Simple Makefile Problem (with a dependency)

Hi all,

I have 4 '.cpp' files and 1 header files:


Code:
Tools.cpp
Code1.cpp
Code2.cpp
Code3.cpp

and Tools.hh

Now all
Code:
Code1.cpp, Code2.cpp, Code3.cpp

use functions stored in
Code:
Tools.cpp

.

Currently, what I do to compile all of them is using
this simple shell script:

Code:
#!/bin/bash
echo "compiling Code1.cpp";
g++ Code1.cpp Tools.cpp -o Code1

echo "compiling Code2.cpp";
g++ Code2.cpp Tools.cpp -o Code2 

echo "compiling Code3.cpp";
g++ Code3.cpp Tools.cpp -o Code3

It all works fine.

Now I want to do that using a standard makefile.
But why this doesnt' work:

Code:
XX = g++

TOOLSRC = Tools.cpp Code1.cpp Code2.cpp \
Code3.cpp    

TOOLSINC = Tools.hh      

all: Code1 Code2 Code3

Code1: $(TOOLSRC) $(TOOLSINC) makefile
                $(CXX)   

Code2: $(TOOLSRC) $(TOOLSINC) makefile
                $(CXX)   

Code3: $(TOOLSRC) $(TOOLSINC) makefile
                $(CXX)


The error I got is this:
Code:
g++
i686-apple-darwin9-g++-4.0.1: no input files
make: *** [Code1] Error 1

 

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
lupdate(1)						      General Commands Manual							lupdate(1)

NAME
lupdate - update Qt Linguist translation files SYNOPSIS
lupdate [ options ] project-file lupdate [ options ] source-files -ts ts-files DESCRIPTION
This page documents the Qt Linguist Update tool for the Qt GUI toolkit. Lupdate reads a qmake/tmake project file (.pro file), finds the translatable strings in the specified source, header and interface files, and updates the translation files (.ts files) specified in it. The translation files are given to the translator who uses Qt Linguist to read the files and insert the translations. The .ts file format is a simple human-readable XML format that can be used with version control systems if required. OPTIONS
-help Display the usage and exit. -noobsolete Drop all obsolete strings. -verbose Explain what is being done. -version Display the version of lupdate and exit. USAGE
Here is an example .pro file that can be given to lupdate: HEADERS = funnydialog.h wackywidget.h SOURCES = funnydialog.cpp main.cpp wackywidget.cpp FORMS = fancybox.ui TRANSLATIONS = gnomovision_dk.ts gnomovision_fi.ts gnomovision_no.ts gnomovision_se.ts When running lupdate on this project file, the translatable strings in all the files listed in the HEADERS, SOURCES and FORMS entries will be put in the translation files listed in the TRANSLATIONS entry. Previous translations will be reused as far as possible, and translated strings that have vanished from the source files are marked obsolete. Lupdate can also be invoked with a list of C++ source files, .ui files and .ts files: lupdate *.cpp *.h *.ui -ts gnomovision_dk.ts SEE ALSO
lrelease(1) and http://doc.trolltech.com/i18n.html Trolltech AS 18 October 2001 lupdate(1)
All times are GMT -4. The time now is 08:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy