Sponsored Content
Top Forums Shell Programming and Scripting Makefile autogenerated by shell script for a given .c code file Post 302275275 by darius2 on Friday 9th of January 2009 03:34:52 PM
Old 01-09-2009
Quote:
Originally Posted by fpmurphy
Have you looked at GNU autotools? GNU build system - Wikipedia, the free encyclopedia
Hi,
spent another day with Makefile and Gnuplot, shell scripting, larning gnuplot to read a script, to read output from shell script , to read data file and more.

One example I follow now
compiling basic .c code examples from the net is:

gcc helloworld.c -o helloworld

It doesn't work for another example .c code program from the net

[admin@oo helloworld]$ gcc squares.c -o squares
squares.c: In function 'main':
squares.c:8: error: expected expression before '=' token
[admin@oo helloworld]$

---------
squares.c code is
what is wrong ?
--------------
#include <stdio.h>
main() {
double x;
FILE *datafile;

datafile = fopen("squares.dat","w");

for(x = 0.0; x < = 4.0; x += 1.0)
fprintf(datafile, "%4.1f %4.1f\n", x, x * x);

fclose(datafile);
}


This program should create data file to be read by gnuplot.

source
Introductory Graphing
Here is a C program to create this file.

(see above)

Darius
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

embeding shell script in makefile

Hi I am new to shell scripting and makefile. I want a command's output in makefile to process further, can anyone plz suggest me a way ? I want ls -d *.dsm output in a variable and want to process it in makefile itself. It's urgent Thanks In advance (0 Replies)
Discussion started by: madhu12345
0 Replies

2. Shell Programming and Scripting

shell script in makefile

Hi, Can we execute a shell script by makefile. I mean we will write a shell script in a make file and it will be executed when we compile the C++ program using make file. (2 Replies)
Discussion started by: surjyap
2 Replies

3. Shell Programming and Scripting

Shell script makefile

Is there a way to write a makefile for all the source files in a directory with a shell script? (2 Replies)
Discussion started by: zzhan
2 Replies

4. Shell Programming and Scripting

turn on shell tracing of a makefile

hey, within a shell script file I know how to turn on tracing using "-x" #!/bin/bash -x now I have a complicated makefile which contains lots of `command`, and i would like to trace these `command`, where shall i put the option "-x"? thanks! (1 Reply)
Discussion started by: patiobarbecue
1 Replies

5. Shell Programming and Scripting

Capture makefile errors in shell script

Hi, I have a bash script which calls a few "make". I would like to know whether the makefile failed with any errors. How do I do that in the script? Thanks, S (2 Replies)
Discussion started by: suryaemlinux
2 Replies

6. Shell Programming and Scripting

Call makefile from shell script

I'm writing a VERY simple shell script. I need to call a makefile in a subdirectory. What's the command I need to use? ./dir/make and ./dir/makefile doesn't work. Thanks in advance (1 Reply)
Discussion started by: yamahabob
1 Replies

7. Shell Programming and Scripting

how to run a shell script through Makefile

I want to run a target defined in a shell script. The shell script name is 'ua.sc' and the target in it is 'N' i.e. (ua N) throught a makefile. How can i do it so that i can run it with a make target. (3 Replies)
Discussion started by: vineet.dhingra
3 Replies

8. Shell Programming and Scripting

using a Shell Script in a Makefile

Hello, I have a Makefile that converts wrl (vrml) files to html files... how can I use a shell script in that makefile which works on all html files after converting? The Shell Script have to find and replace a String in every createt html file. sorry I'm a Newbie, so I hope someone can... (0 Replies)
Discussion started by: Dan_78
0 Replies

9. Shell Programming and Scripting

HTML code upload text file grep through shell script

I am looking for HTML code that browse text file and grep with database file then retrieve result txtfileuploaded contain 112233 115599 113366 shell code grep -F -f txtfileuploaded /data/database.txt result 112233 Mar 41$ 115599 Nov 44$ 113366 Oct 33$ attached... (2 Replies)
Discussion started by: phpshell
2 Replies

10. Shell Programming and Scripting

Shell Script Comment code blocks in a bash source file

Just began to learn on Shell Script. I got an exercise from my friend. I know how to make this happen in C, but I'm not familiar with Shell Script. Hope I can get some help from all of you. I want to write a bash script to comment code blocks in a bash source file. What I mean comment is '#', I... (1 Reply)
Discussion started by: HiFuture0801
1 Replies
MATHO-SUMSQ(1)						       Mathomatic Utilities						    MATHO-SUMSQ(1)

NAME
matho-sumsq - Find the minimum sum of the squares for integers SYNOPSIS
matho-sumsq [numbers] DESCRIPTION
This command-line utility is optionally part of the mathomatic(1) package. It finds the minimum number of positive integers that when squared and added together, equal the given number. There is a proof that no more than 4 squares summed together are required to represent any positive integer. The command-line may contain positive integers to find the minimum squares of, they must be less than 2147483648 (2^31) on 32-bit systems or less than 9223372036854775808 (2^63) on 64-bit systems. If "+" is appended to the given number, the program counts up from the given number. If the minimum number of squares is 2, this program displays all possible combinations with 2 squares for the given number, other- wise it just displays the first combination it finds. If no command-line arguments are given, the programs reads the numbers from standard input. AUTHOR
George Gesslein II (gesslein@mathomatic.org) at "http://www.mathomatic.org". REPORTING BUGS
If you find a bug, please report it to the author or at "https://launchpad.net/mathomatic". SEE ALSO
mathomatic(1), matho-pascal(1), matho-primes(1) Mathomatic MATHO-SUMSQ(1)
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy