I think it's better that you write your task in Makefile.
ls result:
case 1: Compile $ make (red letter is automaticaly added. So do nothing.)
The version of make program I use:
case 2: Better storage maintenance $ make better_storage_maintenance
case 3: Cleaning $ make clean
case 4: look up .c file from .pc file $ make test.c (You need to execute "make better_storage_maintenance" at later)
Gurus,
I am teaching myself C and have a question.
I wrote a small prog that reads characters as entered at the prompt and checks the value for EOF.
Unless I am 100% wrong, the value will be '1' until getchar() has anything to read in my stream.
/* PROG 1 */
#include <stdio.h>
... (4 Replies)
#!/usr/bin/perl
open(STDOUT, ">>$Textfile")
open(STDERR, ">>$Textfile")
print "program running\n";
$final = join("+", $initial,$final) #5
close (STDOUT);
close (STDERR);Hi all, above is my perl code. Notice i have captured the stdout and stderr to the same textfile. my code is expected to... (1 Reply)
Hi,
I am re-writing a script I wrote which emulated the "rm" command, in my orginal script I had problems with precedence, I did find a way round it by creating a seperate case statements which checked the options and performed the actions accordingly, does anyone know if I can use getopts... (1 Reply)
I am new to creating makefiles.
I have several fortran programs in a folder called as "test" and also have several subroutines in another folder (which is inside this test folder) called as libry
My makefile is in the folder "test"
I want to create a makefile which can access the files in... (2 Replies)
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)
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)
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)
Hello,
I am trying to write a small acript to change directory to $HOME depending on the user logged in. However when i provide this command
say,
ABC_USER=myself
cd ~${ABC_USER} i am getting the following error,
ksh: ~myself: not found
I know i am doing something really silly but... (4 Replies)
Hi All,
I am new to unix.
In this forum some days back, I have read something like below:
1) Do not use perl if awk can do your work.
2) Do not use awk if sed can do your work.
.
.
.
I do not re-collect the whole thing. I think it is good to know the precedence of using these... (2 Replies)
Hi All,
We have moved our OS from Sun Solaris to Linux and also some of the compilers.
Our old makefile used to be as below:
CC=cc
FLAGS=-G -KPIC -DLG_SOLARIS_OS
DEFINES=-DSunOS
SYSLIBS=-lc
.SUFFIXES : .c
.c.o : ;$(CC) -c $(FLAGS) $(DEFINES) $*.c -o $*.o
... (3 Replies)
Discussion started by: shash
3 Replies
LEARN ABOUT REDHAT
aimk
AIMK(1PVM) PVM Version 3.4 AIMK(1PVM)NAME
aimk - Portable make wrapper script
SYNOPSIS
aimk [ -here ] [ make arguments ]
DESCRIPTION
aimk is a wrapper program for make, used to portably select options to build PVM and PVM applications on various machines. Each port of
PVM is assigned an architecture name. The name is used both during compilation (to conditionally switch in code) and at runtime (to select
an executable or host).
aimk uses the value of environment variable $PVM_ARCH if it is set, otherwise it calls $PVM_ROOT/pvmgetarch to determine the architecture
name. pvmgetarch is a script that sniffs at various parts of the system to determine the correct architecture name. It is updated as new
PVM ports are defined, and can be augmented locally.
aimk determines the machine architecture and execs make, passing it the architecture and a configuration file along with arguments supplied
to aimk. It runs make in a subdirectory to prevent executables from becoming intermixed and to permit overlapping compiles. A different
makefile can be placed in each subdirectory or a single makefile, Makefile.aimk, can be shared between architectures. Per-architecture
definitions from the $PVM_ROOT/conf directory are appended to the common makefile. aimk calls make is called in one of three ways, depend-
ing on what makefiles are present:
i. If $PVM_ARCH/Makefile or $PVM_ARCH/makefile exists, change directory to $PVM_ARCH and exec make there:
(cd $PVM_ARCH ; make PVM_ARCH=$PVM_ARCH < aimk args >)
ii. Else if Makefile.aimk exists, create $PVM_ARCH directory if it doesn't exist, then:
(cd $PVM_ARCH ;
make -f $PVM_ROOT/conf/$PVM_ARCH.def
-f ../Makefile.aimk PVM_ARCH=$PVM_ARCH < aimk args >)
iii. Else just exec make in current directory:
make PVM_ARCH=$PVM_ARCH < aimk args >
If aimk succeeds in calling make, the exit status is that of make, otherwise it is 1.
FLAGS -here Forces aimk to run make in the current directory, e.g. converts case i. to case iii.
EXAMPLES
The following Makefile.aimk file builds and installs hello, creating the PVM binary directory if it doesn't exist. It can be run concur-
rently on machines of different types, sharing the same source directory.
LDIR = -L$(PVM_ROOT)/lib/$(PVM_ARCH)
PVMLIB = -lpvm3
SDIR = ..
BDIR = $(HOME)/pvm3/bin
XDIR = $(BDIR)/$(PVM_ARCH)
CFLAGS = -g -I$(PVM_ROOT)/include
LIBS = $(LDIR) $(PVMLIB) $(ARCHLIB)
$(XDIR):
- mkdir $(BDIR) $(XDIR)
hello: $(SDIR)/hello.c $(XDIR)
$(CC) $(CFLAGS) -o $@ $(SDIR)/$@.c $(LIBS)
mv $@ $(XDIR)
ENVIRONMENT
$PVM_ROOT Root path of PVM installation.
$PVM_ARCH PVM architecture name for machine.
FILES
$PVM_ROOT/lib/aimk The aimk program
$PVM_ROOT/conf/$PVM_ARCH.def Arch config file
SEE ALSO pvm_intro(1PVM)
02 May, 1994 AIMK(1PVM)