meta data for this page


This shows you the differences between two versions of the page.

Link to this comparison view

courses:ct30a5002:makefiles [2013/09/19 14:37]
julaakko created
courses:ct30a5002:makefiles [2013/09/23 18:50] (current)
Line 1: Line 1:
 +===== Makefiles =====
 +Here is a small example of a makefile for your programs.
 +<code bash>
 +CFLAGS=-Wall -std=gnu99
 +#List sources in separate makefile variables (separate sourcefiles with spaces)
 +#For client ​
 +SOURCES1=csource.c common.c
 +#For server
 +SOURCES2=ssource.c common.c
 +#Multiple lines can be added into one makefile rule
 +#with 'make build' both server and client would be compile.
 +#Use one compilation per line in these exercises.
 +Calling ''​make build''​ would result in:
 +<code bash>
 +gcc -Wall -std=gnu99 csource.c common.c -o client
 +gcc -Wall -std=gnu99 ssource.c common.c -o server
 +[[courses:​ct30a5002:​start#​code_snippets|CT30A5002 - Games and Networking]]