-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (35 loc) · 1.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
###############################################################################
# Makefile for Quines
# A project inspired by Ken Thompson's "Reflections on Trusting Trust"
# and the Jean Paul Belmondo-esque perpetual cool of Brian Kernighan
# Each source file is compiled using gcc, with one of four possible options
# 1. No optimization
# 2. O1 optimization
# 3. O2 optimization
# 4. O3 optimization
#
# all - (default) compile all c files in directory
# clean - clean up compiled object files and executable files
#
#
###############################################################################
EXECUTABLES = quine
SOURCE_FILES = quine.c
GCC = gcc
FLAGS= -g -O -Wall -Wextra -Werror -Wfatal-errors -std=c99
LIBS= -lm
###############################################################################
##############################################################################
#
#
#
###############################################################################
all: $(EXECUTABLES)
###############################################################################
clean:
rm -f *.o
###############################################################################
quine.o: quine.c
$(GCC) $(FLAGS) -c quine.c
quine: quine.o
$(GCC) $(FLAGS) -o quine $< $(LIBS)