Skip to content

Commit c3bd45c

Browse files
committed
Reorganize and modularize
1 parent 8be1db6 commit c3bd45c

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Introduction to C
2+
3+
This repository is the workshop materials for the Linux@App Introduction to C
4+
event.
5+
6+
## Using this Repo
7+
8+
This repository is intended to teach the following skills:
9+
10+
* Basic C compiler usage
11+
* Basic C Preprocessor tricks
12+
* Basic functions
13+
* Basic structures
14+
* How to get help with and use the C standard library
15+
16+
## Prerequisites
17+
18+
You need a UNIX machine with `gcc` and some kind of text editor. Basic programming
19+
experience in another language is also important.
20+
21+
## Getting started
22+
23+
This repository contains a series of makefiles that operate on different files to
24+
automate compilation. Use these as a reference to learn the various flags that the
25+
`gcc` command accepts.
26+

cond.c renamed to cond/cond.c

File renamed without changes.

cond/makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CC = c99
2+
CFLAGS = -pedantic -Wall -Wextra -g
3+
4+
cond-all: cond.E cond
5+
6+
cond.E: cond.c
7+
$(CC) $(CFLAGS) -o cond.E -E cond.c
8+
9+
cond: cond.c
10+
$(CC) $(CFLAGS) -o cond cond.c
11+
12+
clean:
13+
rm *.E cond
14+
15+

first.c renamed to first/first.c

File renamed without changes.

makefile renamed to first/makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,7 @@ first.s: first.c
1515
first.E: first.c
1616
$(CC) $(CFLAGS) -o first.E -E first.c
1717

18-
cond-all: cond.E cond
19-
20-
cond.E: cond.c
21-
$(CC) $(CFLAGS) -o cond.E -E cond.c
22-
23-
cond: cond.c
24-
$(CC) $(CFLAGS) -o cond cond.c
25-
2618
clean:
27-
rm *.o *.s *.E first cond
19+
rm *.o *.s *.E first
2820

2921

0 commit comments

Comments
 (0)