Thread: Create batch file to compile and run programs

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Create batch file to compile and run programs

    Hi all,

    I have to create a batch file in unix that compiles and runs two *.c files.

    Could someone please tell me either were to look or how to do this?

    Thanks heaps

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    I didn't heard anything like batch file for unix / linux

    if you want to compile two *.c files then better write your own Makefile

    Code:
    gcc -g -c -Wall test1.c test2.c
    gcc -o test test1.o test2.o

  3. #3
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    Or what you can do write your own shell script

    and just call

    Code:
    make all

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Not batch...shell scripting. Or you could use a makefile.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. Replies: 5
    Last Post: 10-25-2007, 12:27 PM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. how to compile & run c programs in unix?
    By Unregistere in forum C Programming
    Replies: 2
    Last Post: 10-09-2002, 10:53 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM