<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cs.indstate.edu/web/index.php?action=history&amp;feed=atom&amp;title=C_Starting</id>
	<title>C Starting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cs.indstate.edu/web/index.php?action=history&amp;feed=atom&amp;title=C_Starting"/>
	<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=C_Starting&amp;action=history"/>
	<updated>2026-04-14T21:49:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://cs.indstate.edu/web/index.php?title=C_Starting&amp;diff=189&amp;oldid=prev</id>
		<title>Jkinne: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=C_Starting&amp;diff=189&amp;oldid=prev"/>
		<updated>2025-08-17T13:22:15Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:22, 17 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki2:diff:1.41:old-188:rev-189 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jkinne</name></author>
	</entry>
	<entry>
		<id>https://cs.indstate.edu/web/index.php?title=C_Starting&amp;diff=188&amp;oldid=prev</id>
		<title>wiki_previous&gt;Jkinne: /* Makefile */</title>
		<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=C_Starting&amp;diff=188&amp;oldid=prev"/>
		<updated>2022-09-05T23:38:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Makefile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=On CS Systems - gcc=&lt;br /&gt;
For CS courses that use C, the gcc compiler is often used. This is already installed on the CS server. To get started do the following.&lt;br /&gt;
* Use a terminal text editor (see [[Text Editors]]) to edit your C program file.  Let&amp;#039;s say your program is &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* Compile the program using the gcc command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc hello.c -o hello.o&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you do not have any errors in your program, the file &amp;lt;code&amp;gt;hello.o&amp;lt;/code&amp;gt; will be created.&lt;br /&gt;
* Run the program by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./hello.o&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use the classic &amp;quot;hello world&amp;quot; program as a first attempt.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
  printf(&amp;quot;Hello world!\n&amp;quot;);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
gcc is documented at https://gcc.gnu.org/onlinedocs/&lt;br /&gt;
&lt;br /&gt;
==Makefile==&lt;br /&gt;
Rather than type the gcc command each time you want to compile, you can put the right commands into a Makefile and use the &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command.  The following is a basic Makefile which will compile all &amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt; files in the current directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SHELL = /bin/sh&lt;br /&gt;
CFLAGS = -g -Wall -O0&lt;br /&gt;
SRCS = $(wildcard *.c)&lt;br /&gt;
OBJS = $(SRCS:.c=.o)&lt;br /&gt;
&lt;br /&gt;
all: $(OBJS)&lt;br /&gt;
&lt;br /&gt;
%.o : %.c&lt;br /&gt;
	-gcc $(CFLAGS) $&amp;lt; -o $@&lt;br /&gt;
&lt;br /&gt;
clean:&lt;br /&gt;
	rm -f *.o&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Save this file with the filename &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;.  Then type &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; to compile all of the .c files.  Type &amp;lt;code&amp;gt;make clean&amp;lt;/code&amp;gt; to remove the compiled .o files, to then recompile all .c files with the next &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Note that the make command invokes GNU Make, which is documented at https://www.gnu.org/software/make/manual/make.html&lt;/div&gt;</summary>
		<author><name>wiki_previous&gt;Jkinne</name></author>
	</entry>
</feed>