Simple make file questions....i think, thnx

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Simple make file questions....i think, thnx
# 1  
Old 02-01-2008
Simple make file questions....i think, thnx


I'm a noob when comes to make files....

My intentions for the use of my make file are not that of a usual compilation, etc.

It is simply to copy some files from a RCS controlled area to a public area which has read rights only for a web page.

My dilemma comes in the form of sub directories and how to handle them and the files in them.

Let say that I have the following dir structures.



I want to copy all files from

as well as all the files in the sub directories.


Here is what I have so far:

DESTDIR1 = mydomain/public_htm/test1
DESTDIR2 = mydomain/public_htm/test1/test1sub

TARGETS1 = test1.html
TARGETS2 = testsub1.html .htaccess user.pass
SOURCES = test1.html testsub1.html .htaccess user.pass

all: $(TARGETS1) $(TARGETS2)

install1: $(TARGETS1)
if [ ! -d $(DESTDIR1) ] ; then mkdir -p $(DESTDIR1); fi
@for f in $(TARGETS1) ; \
do \
/usr/sbin/install -c $(DESTDIR1) -m 444 $$f ; \
install2: $(TARGETS2)
if [ ! -d $(DESTDIR2) ] ; then mkdir -p $(DESTDIR2); fi
@for f in $(TARGETS2) ; \
do \
/usr/sbin/install -c $(DESTDIR2) -m 444 $$f ; \

install: install1 install2

BTW, this make file resides in the dir:

I have used this approach when only one directory and multiple files need to be copied and it has worked.

I've read the man pages and the info pages and I'm still a bit lost on how to implement this.

I've seen the suggestions of having another make file in the sub directory, etc, etc, etc.

I really want to know what the best approach is, and some hints on how to implement it.

A few other things to note, it doesn't seem to want to copy over the .htaccess file, any suggestions.

Thank you in advance.

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Simple questions about LPARs

Hello, I am looking into virtualizing AIX 7.1 on our p7 machine that already has AIX 7.1 installed on it. I have a few questions about them: 1) In order to gain LPAR functionality, do I need to purchase PowerVM software? 2) I read that LPARs are managed from locally attached graphical... (1 Reply)
Discussion started by: bstring
1 Replies

2. AIX

Simple AWK cleanup/questions AIX

I have an unfortunate need to redo a bunch of disk settings on a VIOS on AIX, so I was putting together a quick script to scrub everything it has, make the changes, and then put the mappings back. It works, I just am trying to get my awk a bit more up-to-snuff and wanted to know the proper way to... (2 Replies)
Discussion started by: Vryali
2 Replies

3. Shell Programming and Scripting

Script to make simple recurring ascii file edit

Hi, I have an ascii file with recurring lines (the file is 36mb so lots of lines) which look like this: -2.5 -66.324-68.138 935.2 1.953 -0.664 272.617 73.684 -2.428 269.998 0.000 Every 14 lines there is a blank line. I would like to, for each non-blank line,... (2 Replies)
Discussion started by: blueade7
2 Replies

4. UNIX for Dummies Questions & Answers

Simple ed questions - insert line with dot

Hi I've got a trivial question on using ed (yes, I know, other editors are better!) How do I insert a line that is just a single dot? (That is, how do I insert a line that starts with a dot and then new line) Thanks Peter (4 Replies)
Discussion started by: peterl
4 Replies

5. Solaris

Questions about make -C in SunOS

I am using a SunOS to compile a project. The Makefile contains commands "$(MAKE) -C $$dir". However, in "man make" there is no -C option. I tried using MAKE=gmake but it failed too. My questions: 1. The make options for this SunOS is different from the gnu make options. Is it because of the... (4 Replies)
Discussion started by: yzhang
4 Replies

6. UNIX for Dummies Questions & Answers

2 simple questions the linux pros will be able to get. Pleese help!

Allright the situation is that i have a dual boot set up with windows xp and red hat 9.0. the problem is that my modem and sound card dont work with linux. I found a driver, and i have to download it with xp. My question is..... How do i actually copy the file to the linux... (4 Replies)
Discussion started by: nregenwether
4 Replies

7. UNIX for Dummies Questions & Answers

2 Simple Questions

Hi, I am a dummy in unix. I have 2 simple questions. 1) I am the adminstrator. I want to set a alias that applied to all the users. I do not want to update each user's .profile or .cshrc file. So is there a way to update it in one file so that it applies to all users ? Example : I want... (1 Reply)
Discussion started by: champion
1 Replies

8. UNIX for Dummies Questions & Answers

Simple questions

hi, i am a total dummy of unix. i want to find out the following information from my Sun Solaris 8 Unix machine: 1) The command to display physical and virtual memory 2) The command to display the CPU 3) The command to display the total harddisk space. thank u very much and have a nice... (3 Replies)
Discussion started by: champion
3 Replies

9. UNIX for Dummies Questions & Answers

Simple grep questions

Hi all, My boss wants me to find out how often e-m users are accessing their account:confused:. The mail server keeps log of all logins. I want to use grep the 'usernames', but it should come out the moment it first encounters the username in the log. Can I do that? I want to avoid 10+ greps... (2 Replies)
Discussion started by: nitin
2 Replies
Login or Register to Ask a Question