LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-03-2004, 11:34 AM   #1
Veteq
Member
 
Registered: Feb 2004
Posts: 155

Rep: Reputation: 30
creating my own commands


I don't know where to start

when I compile a program I have to type the following line


xlc myprog.c -q source -o myprog.out

I would like to be able to type

compile myprog.c

and get the same result...

is it possible? is it done in shell script of C?

please help

thank you
 
Old 06-03-2004, 11:48 AM   #2
flakzeus
Member
 
Registered: Jan 2004
Location: Salisbury, NC
Distribution: Gentoo 2004.1
Posts: 48

Rep: Reputation: 15
you can do that through shell scripts. You should read up on this: http://vertigo.hsrl.rutgers.edu/ug/shell_help.html
 
Old 06-03-2004, 01:13 PM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 31
Read up on how to create makefiles and then you can just do something like:

make

or

make myprog

Actually, if it's just a C/C++ file and you don't need any special libraries, you can usually just do

make myprog

without a Makefile, and it will automatically build files with a .c extension using gcc, or if it's got a .cpp extension, it will compile it with g++...

I've never used xlc before, so maybe that does something that would require you to add more to a makefile than if you were just using gcc, though...

Last edited by deiussum; 06-03-2004 at 01:15 PM.
 
Old 06-06-2004, 02:38 PM   #4
Veteq
Member
 
Registered: Feb 2004
Posts: 155

Original Poster
Rep: Reputation: 30
thank you for all your help, I was able to get the command working using shell script.

Veteq
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating your own text commands to start programs in Terminal? ljr2600 Linux - Newbie 3 06-23-2005 07:27 AM
Question on creating icon to execute commands satimis Programming 7 10-19-2004 11:55 AM
Creating a script to run two commands anjaan Programming 11 06-15-2004 02:51 AM
Creating Batch Commands? reefadt Linux - Newbie 3 08-17-2003 09:46 AM
commands TazLinux Linux - General 2 06-14-2003 02:31 AM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration