Easy UNIX question

RalphTheCow

Senior member
Sep 14, 2000
963
380
136
Can you use the make command to copy directories? I think the system I'm working on does that if you type make filename, and stores it in filename.tar.Z.

I'm a casual UNIX user, and the man page as usual doesn't help much. Does this sound reasonable?
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
That's not what make does, make is there to easy the compilation and installation of programs.
It uses a Makefile to compile stuff properly, this makefile specifies header dependencies and such.

The old "./configure && make && make install" is how most people get in touch with make.

If you wanna copy directories, just use "cp -r", that's what it's there for.
If you wanna tar a directory, use "tar -cf /path/to/your/file.tar /the/dir/your/wanna/tar".

[edit] Oh and here is the OpenBSD make manpage, FYI.
Explains it pretty well.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)
 

RalphTheCow

Senior member
Sep 14, 2000
963
380
136
OK, this is on a Solaris 2.5 system. How can I find out how the command "make filename" works? File "filename" is nowhere on the system that I can find, but running this command produces filename.tar.Z in the /opt directory. I found a default make.rules file in /usr/share/lib/make, but it looks like an explosion in a puncuation factory to me.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
How can I find out how the command "make filename" works?

Read the manpage Sunner linked to? :confused:

make looks for the file "Makefile" in the current directory and does things based on the rules contained therein.
 

HKSturboKID

Golden Member
Oct 20, 2000
1,816
0
0
I guess Make is the symbolic link to makefile then.

its 2:30pm, i think I go MAKE myself a sandwich. ;)
 

RalphTheCow

Senior member
Sep 14, 2000
963
380
136
Oops, I needed ls -A to see that hidden Makefile, my habit is to use l, a link to ls -l.

Hey, I told you it was an easyquestion.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: HKSturboKID
I guess Make is the symbolic link to makefile then.

No, make is a program which reads in a makefile and then does things based on what's in it. The makefile itself is not executed, and even if it were, a symbolic link can't even work in the way that we're talking about.
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: BingBongWongFooey
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)

Yeah, well I don't think alot of people use it for much more than the above mentioned use, even though I guess you could use it for most anything if you really really wanted ;)
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: Sunner
Originally posted by: BingBongWongFooey
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)

Yeah, well I don't think alot of people use it for much more than the above mentioned use, even though I guess you could use it for most anything if you really really wanted ;)

I've seen some pretty byzantine make systems that did all sorts of things beyond just building the code. Complete PITA to maintain ... I hate makefiles, but haven't come across anything better just yet.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: Armitage
Originally posted by: Sunner
Originally posted by: BingBongWongFooey
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)

Yeah, well I don't think alot of people use it for much more than the above mentioned use, even though I guess you could use it for most anything if you really really wanted ;)

I've seen some pretty byzantine make systems that did all sorts of things beyond just building the code. Complete PITA to maintain ... I hate makefiles, but haven't come across anything better just yet.

scons?
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: Armitage
Originally posted by: Sunner
Originally posted by: BingBongWongFooey
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)

Yeah, well I don't think alot of people use it for much more than the above mentioned use, even though I guess you could use it for most anything if you really really wanted ;)

I've seen some pretty byzantine make systems that did all sorts of things beyond just building the code. Complete PITA to maintain ... I hate makefiles, but haven't come across anything better just yet.

Yeah, I've ran into a few weird uses for make too, I hate that crap.
Some people seem to just love making things complicated.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: BingBongWongFooey
Originally posted by: Armitage
Originally posted by: Sunner
Originally posted by: BingBongWongFooey
Actually make can be used for all kinds of things, not just building. But in general you might as well just use scripts for the other stuff. Make sucks. :p (actually it's kinda cool for little stuff, but it quickly grows into insanity)

Yeah, well I don't think alot of people use it for much more than the above mentioned use, even though I guess you could use it for most anything if you really really wanted ;)

I've seen some pretty byzantine make systems that did all sorts of things beyond just building the code. Complete PITA to maintain ... I hate makefiles, but haven't come across anything better just yet.

scons?

I looked into that once when it was still beta. To be honest, it didn't look that much better then make to me. Maybe I'll have another look.
At the moment, my builds are failry simple, so make isn't to bad. That and I haven't written any significant C/C++ in months :(