Skip to content

Commit aba3265

Browse files
committed
Compiler example
1 parent 999aa9d commit aba3265

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

first.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
printf("Hello!");
5+
}

makefile

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

0 commit comments

Comments
 (0)