-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.3
35 lines (28 loc) · 1.01 KB
/
Makefile.3
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
CC=gcc
FORMAT=clang-format
N=3
bin=slider$(N)
CFLAGS=-g -std=c90 -pedantic -Wall -Wextra -DSQSTR=\"ABCDEFGHI\" -DWxH=$(N)
FORMATFLAGS=-i -style=WebKit
.PHONY: all clean format
all: $(bin)
$(bin): main$(N).o slider$(N).o sliderio$(N).o function$(N).o opt$(N).o lcg$(N).o minstd$(N).o
$(CC) $(LDFLAGS) -o $(bin) main$(N).o slider$(N).o sliderio$(N).o function$(N).o opt$(N).o lcg$(N).o minstd$(N).o
clean:
rm -f *.o $(bin) *.exe
format:
$(FORMAT) $(FORMATFLAGS) *.c *.h
function$(N).o: function.c function.h
$(CC) -c $(CFLAGS) -o function$(N).o function.c
main$(N).o: main.c slider.h sliderio.h opt.h function.h
$(CC) -c $(CFLAGS) -o main$(N).o main.c
opt$(N).o: opt.c opt.h
$(CC) -c $(CFLAGS) -o opt$(N).o opt.c
slider$(N).o: slider.c slider.h
$(CC) -c $(CFLAGS) -o slider$(N).o slider.c
sliderio$(N).o: sliderio.c sliderio.h
$(CC) -c $(CFLAGS) -o sliderio$(N).o sliderio.c
lcg$(N).o: lcg.c lcg.h
$(CC) -c $(CFLAGS) -o lcg$(N).o lcg.c
minstd$(N).o: minstd.c minstd.h lcg.h
$(CC) -c $(CFLAGS) -o minstd$(N).o minstd.c