Sponsored Content
Full Discussion: Unix Make
Top Forums Programming Unix Make Post 302146790 by porter on Thursday 22nd of November 2007 08:05:30 AM
Old 11-22-2007
Hi,

Two main things to understand about make...

1. it's all based around dependancies

2. those dependancies all center around the date of a file.

If you have hello.c and want to build it, then create a "Makefile" as follows...

Code:
all: hello

hello.o: hello.c
      $(CC) $(CFLAGS) -c hello.c -o $@

hello: hello.o
      $(CC) $(CFLAGS) hello.o -o $@

The macros CC and CFLAGS are standard macros for your C compiler.

$@ means the target for the rule

So it will say, I want to make "all", so I want to make "hello", that depends on "hello.o" and here are the rules. Ah, I need hello.o first, and there are the rules to make that.

make (software) - Wikipedia, the free encyclopedia
 

10 More Discussions You Might Find Interesting

1. Programming

How can I make ls -l in HP-UNIX?

I made a liitle source about that.. BUt I got a trouble when making files'authority.. How can I display them?? p.s.) used struct stat .. (1 Reply)
Discussion started by: sangjinn
1 Replies

2. UNIX Desktop Questions & Answers

Make file in Unix

How to make files in Unix (6 Replies)
Discussion started by: gandhevinod
6 Replies

3. Shell Programming and Scripting

how to make VI editor show colors in Unix

Hi, I saw some people's vi editor show different colors on the text according the nature of text when using it. It would be nice if I can see diffrerent colors with my vi editor. Do anybody know how to set it up? I use PowerTermPro program to access unix machine. I tried to use vim editor but... (7 Replies)
Discussion started by: whatisthis
7 Replies

4. UNIX for Dummies Questions & Answers

Make a copy of a unix HDD

i have this HDD with SCO 5.0.6 and i'm getting this errors WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8 Sun Mar 11 05:50:08 2007 status=0x00000040, LBA sector=1285723, cylinder/head=5022/0 WARNING: wd0: Error... (0 Replies)
Discussion started by: josramon
0 Replies

5. UNIX for Dummies Questions & Answers

How to make sound using C under UNIX

i'm programming using C under UNIX. i wonder to how make sound using C ? any sound like "beep" would be fine. thx. :confused: (6 Replies)
Discussion started by: trapeze
6 Replies

6. Solaris

how to make file link in c under unix

how to make link command by c language (2 Replies)
Discussion started by: ma7moudax
2 Replies

7. Hardware

How to make terminals with a PC(UNIX/LInux) support?

I want to build a network, in this network there is only one PC and 50 terminals, 50 students can use this system to study UNIX/Linux. In the old days, computer was very expensive, many scientists shared a computer with terminals, that means a terminal has no cpu, memory and hardisk. In... (5 Replies)
Discussion started by: haixiao_liu
5 Replies

8. HP-UX

HP-unix make file Problem

Dear Unixians, I have try to link my libraries with tuxedo that showing following errors, ] My make file few lines: .... actual linking regards, kkl (1 Reply)
Discussion started by: kkl
1 Replies

9. Shell Programming and Scripting

How can i make a report from some insert in UNIX shell?

I have some insert in my unix shell script. This every insert has a spool (a file with datas) and a sql file with the query. I have to create a report file with three columns: The first(TAB_NAME) will contains the name of the table in wich has been done the insert, the second (STATE) will... (7 Replies)
Discussion started by: punticci
7 Replies

10. Shell Programming and Scripting

Make bold chars in UNIX

Hi all, I want to make the string as bold in unix. is there any way to acheive this? thanks in advance. (16 Replies)
Discussion started by: SekhaReddy
16 Replies
ns_file(3aolserver)					    AOLserver Built-In Commands 				       ns_file(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_chmod, ns_cp, ns_cpfp, ns_ftruncate, ns_link, ns_mkdir, ns_rename, ns_rmdir, ns_symlink, ns_truncate, ns_unlink - File manipulation com- mands SYNOPSIS
ns_chmod option ?arg arg ...? ns_cp option ?arg arg ...? ns_cpfp option ?arg arg ...? ns_ftruncate option ?arg arg ...? ns_link option ?arg arg ...? ns_mkdir option ?arg arg ...? ns_rename option ?arg arg ...? ns_rmdir option ?arg arg ...? ns_symlink option ?arg arg ...? ns_truncate option ?arg arg ...? ns_unlink option ?arg arg ...? _________________________________________________________________ DESCRIPTION
ns_chmod filename mode Change a file's access permissions. ns_chmod changes the specified file's permissions to mode, in the same manner as the Unix chmod(1) command-line utility. ns_cp -preserve file1 file2 Copy one file to another. ns_cp copies the contents of file1 to file2, just like the Unix "cp" command. The default directory is the home directory for the server. If -preserve is specified, the copied file will retain the creation time, modification time, owner, and mode of the original file, just like the Unix "cp -p" command. ns_cpfp fileid1 fileid2 ?nbytes? Copy a specified number of bytes from one file to another. ns_cpfp copies information from one file (fileid1) to another (fileid2). If you specify a number of bytes in the nbytes argument, only the specified number of bytes will be copied. By default, the entire file is copied. ns_ftruncate fileid ?length? Truncate an open file to a specified length. ns_ftruncate causes the open file specified by fileid to have a size of length bytes. If length is not specified, it causes the file to have a size of zero bytes. The file must be open and be a regular file. ns_link ?-nocomplain? filename1 filename2 Create a link. ns_link creates a link named filename2 that points to the file specified by filename1. If the link fails, a Tcl error is generated, unless -nocomplain is specified. ns_mkdir path Create a directory. ns_mkdir creates the directory named PATH, just like the Unix mkdir command. By default, under Unix the direc- tory is created with the file permissions set to 0755 (rwxr-xr-x.). These permissions can be modified by setting the umask parameter for the server. ns_rename file1 file2 Rename a file. ns_rename renames the first file (file1) to the file name specified by file2. Make sure that the files and the directories in which the files exist are read/write accessible to the username that's running the AOLserver. ns_rmdir path Remove a directory. ns_rmdir removes the directory named path, just like the Unix rmdir command. The directory must already be empty. ns_unlink [-nocomplain] filename Remove a file. ns_unlink attempts to remove the file filename. If -nocomplain is not passed in and the removal fails, a Tcl error is generated. ns_truncate filename ?length? Truncate a file to a specified length. ns_truncate causes the file specified by filename to have a size of length bytes. If length is not specified, it causes filename to have a size of zero bytes. The file must exist and be a regular file. ns_unlink [-nocomplain] filename Remove a file. ns_unlink attempts to remove the file filename. If -nocomplain is not passed in and the removal fails, a Tcl error is generated. SEE ALSO
ns_chmod, ns_cp, ns_cpfp, ns_ftruncate, ns_link, ns_mkdir, ns_rename, ns_rmdir, ns_symlink, ns_truncate, ns_unlink KEYWORDS
AOLserver 4.0 ns_file(3aolserver)
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy