The make tool is designed for this. When you run 'make', it reads Makefile from the current directory to see if it needs to build anything.
Here's a simple Makefile that creates output from file1, file2, file3, file4:
Note that the eight spaces in front of the cat command are actually one tab and must be a tab for make to understand the file.
The first line tells it to make output from the files listed after :. I think wildcards are allowed, so you could put that as file* instead of file1 file2 file3 file4. When you run make, it will check if any of the input files are newer than output and re-create it if necessary. If none of those files are newer than output, it will do nothing.
You can specify as many rules as you want, in any order, but the first rule is the one it actually attempts to build, so, you'd usually have an empty rule like:
at the top, which will cause make to check the rules to build output1, output2, output3, output4, etc.
Last edited by Corona688; 04-13-2010 at 06:21 PM..
I'm trying to use a shell script to compile and execute a java file. The java classes are using sockets, so there is a client.java file and a server.java file, each with their own shell script. I also want to handle the command line arguments within the shell script, not the java classes. The... (1 Reply)
I seem to have issues compiling software and I think I've narrowed it down to something having to do with having a space in the path name to my Home folder (which contains "Macintosh HD"). The reason I think this is shown here:
$ echo $HOME
/Volumes/Macintosh HD/Users/Tom
$ cd $HOME
-sh:... (7 Replies)
There are around 13 files in folder1.I need to move these files to another folder folder2,one file at a time, after checking whether a file exists in another folder folder3.
If a file exists in folder3, we should not move files from folder1 to folder2.
If there are no files in folder3, we need... (1 Reply)
Hi.,
Last modified time of the folder is changing when I view the file inside the directory. Here is the test on sample directory. I believe that ls -l commands gives the time detail w.r.t last modified time. Pl. suggest.
bash-3.2$ mkdir test
bash-3.2$ cd test
bash-3.2$ touch myfile.txt... (2 Replies)
I am compling simple java program HelloWorld.java
although /usr/bin @ this path javac is present,
is there any command line wherein i can pass the this option as well
lik javac -opttion(javac path) filename.java
as i do not have permissions to set path.
Also wht does this error, means...... (0 Replies)
hi all,
I need to find out the last 2 modified files in a folder.There is some way by which,we can check the timestamp and find out..??please help this is urgent.
Thanks in Advance
Anju (3 Replies)
I need Help folks;
I'm very new to Java & i was trying to compile some java files & i got a lot of errors (see below), could some one tell me what am i doing wrong?
These are the files i need to compile:
AddCommentActionLogging.java
EditPageActionLogging.java
When i run:... (4 Replies)
I think that's what I'm trying to do. This is the problem:
I log onto my comp, Comp1. Then, from the terminal, since my web server is on another comp, I type: xrlogin Comp2, so I log on to that computer. I then navigate to my directory by typing: cd /domain/myDir, so I am in my directory, on the... (3 Replies)
Hi ,
I don't know if this is the right place to post my question because it relates to JAVA . I am beginner of JAVA , using a tutorial as reference I am trying to run a simple program in JAVA env. I have installed JDSK kit from java.sun.com but when I tried to run a program from the DOS prompt , I... (7 Replies)