07-05-2005
Here is one sample makefile for your purpose
# Sample Makefile
SHELL=/bin/sh
.KEEP_STATE:
# Include .cpp in suffixes list
.SUFFIXES:$(.SUFFIXES) .cpp
# Rule for .cpp to .o
.cpp.o:
${COMPILE.cc} -o $@ $<
SOURCE_PATH=${HOME}/source
INCLUDE_PATH=-I.
OBJECTS = ${SOURCE_PATH}/a.o
TARGET=a.out
CPPFLAGS=${INCLUDE_PATH}-mt
all : ${TARGET}
${TARGET}: ${OBJECTS}
$(CCC) -o ${TARGET} ${OBJECTS}
clean:
$(RM) ${TARGET} ${OBJECTS}
In case the source files and Header files are present in other directories, then modify the paths pointed by variables INCLUDE_PATH and SOURCE_PATH respectively..
I hope I am clear with the description.
Note: Kindly see the bolded commands starting with spaces. These are not the spaces but Tab.
Last edited by amit_sapre; 07-05-2005 at 11:04 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
Discussion started by: hazno
0 Replies
2. UNIX for Advanced & Expert Users
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
3. UNIX for Advanced & Expert Users
Hi,
I have a few questions about makefiles. I have defined my own version of a dependency file (.d) by creating it in code and called it say .dd. Now this file I have included in the makefile with the include statement. (There are a whole bunch of these files so I've defined this as a rule which... (2 Replies)
Discussion started by: shishirm
2 Replies
4. Programming
Hi all,
I'm new to make files . I'm writing a make file to compile and create .so files. i've 20 .cpp files. I want to compile one file at a time and then i've to create 1 .so for each file that i compiled.
for eg:
list.mk is having all the 20 .spp files.
name = a.cpp
name =+... (2 Replies)
Discussion started by: vij_krr
2 Replies
5. Shell Programming and Scripting
Hi,
I have a requirement as below which needs to be done viz UNIX shell script
(1) I have to connect to an Oracle database
(2) Exexute "SELECT field_status from table 1" query on one of the tables.
(3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies
6. UNIX for Advanced & Expert Users
I have 2 libraries in 2 different directories that I build with Makefiles.
library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A?
I am now rebuilding A, followed by B... but I'd like B to... (0 Replies)
Discussion started by: wwuster
0 Replies
7. Homework & Coursework Questions
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
8. Homework & Coursework Questions
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:
I have been trying to make the program swap but i have been getting errors with the makefile such as
driver.o:... (1 Reply)
Discussion started by: mgyeah
1 Replies
9. Shell Programming and Scripting
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Discussion started by: DevendraG
2 Replies
10. Shell Programming and Scripting
Dear all,
I have a quite simple question about how to manipulate "makefile.am". I intend to:
1. "CFLAGS" and "CXXFLAGS" have no value at all. I know that these values get "-g -O2" by default. On the other hand, when I try to set them as "CFLAGS = " in "makefile.am", I get warning messages... (4 Replies)
Discussion started by: Dandan
4 Replies
LEARN ABOUT DEBIAN
zipios_gzipoutputstream
zipios::GZIPOutputStream(3) Library Functions Manual zipios::GZIPOutputStream(3)
NAME
zipios::GZIPOutputStream -
SYNOPSIS
#include <gzipoutputstream.h>
Public Member Functions
GZIPOutputStream (std::ostream &os)
GZIPOutputStream constructor.
GZIPOutputStream (const std::string &filename)
GZIPOutputStream constructor.
void setFilename (const string &filename)
void setComment (const string &comment)
void close ()
Calls finish and closes the stream.
void finish ()
Finishes the stream.
virtual ~GZIPOutputStream ()
Destructor.
Detailed Description
GZIPOutputStream is an ostream that writes the output to a gz file. The interface approximates the interface of the Java GZIPOutputStream.
Definition at line 17 of file gzipoutputstream.h.
Constructor & Destructor Documentation
zipios::GZIPOutputStream::GZIPOutputStream (std::ostream &os) [explicit]
GZIPOutputStream constructor. Parameters:
os ostream to which the compressed zip archive is written.
Definition at line 13 of file gzipoutputstream.cpp.
zipios::GZIPOutputStream::GZIPOutputStream (const std::string &filename) [explicit]
GZIPOutputStream constructor. filename to write the gzip archive to.
Definition at line 22 of file gzipoutputstream.cpp.
zipios::GZIPOutputStream::~GZIPOutputStream () [virtual]
Destructor.
Definition at line 51 of file gzipoutputstream.cpp.
Member Function Documentation
void zipios::GZIPOutputStream::close ()
Calls finish and closes the stream.
Definition at line 39 of file gzipoutputstream.cpp.
void zipios::GZIPOutputStream::finish ()
Finishes the stream.
Definition at line 46 of file gzipoutputstream.cpp.
Author
Generated automatically by Doxygen for Zipios++ from the source code.
Zipios++ Mon Oct 10 2011 zipios::GZIPOutputStream(3)