Sponsored Content
Top Forums Programming Makefile for more than 1 executable program Post 302386930 by pludi on Thursday 14th of January 2010 05:30:27 AM
Old 01-14-2010
Assuming you're using GNU make:
Code:
SRC=blah1.c blah2.c blah3.c
HDR=$(SRC:.c=.h)
OBJ=$(SRC:.c=.o)

PROG=$(SRC:.c=)

all: $(PROG)

$(PROG): $(OBJ)
        gcc -Wall -ggdb -o $@ $@.o

.c.o: $(SRC) $(HDR)
        gcc -Wall -ggdb -c $<

clean:
        rm -f $(PROG) $(OBJ)

Adjust the compile options as needed.
 

10 More Discussions You Might Find Interesting

1. Programming

launch an executable from a C++ program

Hi everybody! Could you please tell me how can I launch an executable from a C++ (on unix) program? thanks in advance! (2 Replies)
Discussion started by: nadiamihu
2 Replies

2. Programming

problem in creating executable for a client program

Hi, I am trying to run simple client server c program in unix.At the compling stage server is creating an executable but the client is not. below is the link to the source codes: http://www.cs.rpi.edu/courses/sysprog/sockets/server.c http://www.cs.rpi.edu/courses/sysprog/sockets/client.c ... (2 Replies)
Discussion started by: konas
2 Replies

3. Programming

Client and Server program gen by Makefile

I created a "ebanking.x" file and run it as " rpcgen -a ebaning.x" It gen a few of files to me which is - "ebanking.h", "ebanking_server.c", "ebanking_svc.c", "ebanking_client.c", "ebanking_clnt.c", "ebanking_xdr.c" and "Makefile" The content of "ebanking.x" : struct bankargs { ... (0 Replies)
Discussion started by: wongalan48
0 Replies

4. Programming

Makefile compilation Error -Unable to create executable

Hi , While trying to compile a PRO*C code on unix using makefile i get the following errors. i am now working on a 10g migration (from 8i) ... these makefile perfectly work in previous version. ld: fatal: file... (7 Replies)
Discussion started by: sivalives
7 Replies

5. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

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)
Discussion started by: hernandinho
2 Replies

6. Programming

how to call c executable inside c program??

hi guys i have only basic knowledge of c so guys plz help me ..... i want 2 call c executable which requires file name as argument and i need to modify file contents before calling that executable now my question is how can i call this c executable inside another c program with arguments ?? i... (9 Replies)
Discussion started by: zedex
9 Replies

7. Programming

Call a C programming executable inside a C program

hi guys i have only basic knowledge of C so guys plz help me ..... is C language support call the C executable inside the C ?? example contect mainA.c have a many function define in the struct,when i compile mainA and make a executable the name is ( A ),can i use executable C inside the C... (5 Replies)
Discussion started by: isnoname
5 Replies

8. Shell Programming and Scripting

To see if a program exist and is executable

Hi, I am making a program that needs to detect if the program name in parameter is a valid runable program. But the line if ; then never seem to work. Even if I run like: ./script cat "-u" cat "-u" inputfile Thank you everyone. #!/bin/bash # usage() { #print usage message and quit... (4 Replies)
Discussion started by: leonmerc
4 Replies

9. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

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)
Discussion started by: Tatl
1 Replies

10. AIX

Error when run makefile to compile C program

I have a make file for C program, which always gives the error ld: 0711-738 ERROR: Input file ../src/file_name.o XCOFF32 object files are not allowed in 64 mode Does anybody know the problem? Thanks for contribution (2 Replies)
Discussion started by: digioleg54
2 Replies
FILESCHANGED(1) 						   User Commands						   FILESCHANGED(1)

NAME
fileschanged - displays altered files SYNOPSIS
fileschanged [OPTION...] [FILE]... DESCRIPTION
Monitors FILEs for alterations. Display the filenames of FILEs that were created, changed, deleted, started execution or finished execut- ing. -s, --show=EVENT[,...] Display created, changed, deleted, executing, or executed files (Default is "created,changed") -a, --show-all Display all file events and the associated action -f, --files-to-monitor (Default) Monitor the FILEs on the command line -l, --filelist=FILE Monitor the list of filenames inside FILE -L, --dereference Don't monitor symlinks, monitor what's pointed to -r, --recursive Monitor subdirectories of directories -t, --timeout=N Delay showing changed files for N seconds (Def=2) -p, --display-action Display action when showing altered files -x, --exec=PROG Run PROG when file is altered (PROG action filename) -?, --help Give this help list --usage Give a short usage message -V, --version Print program version FILEs must exist when monitoring begins, or they will not be monitored. REPORTING BUGS
Report bugs to <benasselstine@users.sf.net>. SEE ALSO
The full documentation for fileschanged is maintained as a Texinfo manual. If the info and fileschanged programs are properly installed at your site, the command info fileschanged should give you access to the complete manual. fileschanged 0.6.5 October 2011 FILESCHANGED(1)
All times are GMT -4. The time now is 03:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy