-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (44 loc) · 814 Bytes
/
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
49
50
51
52
CC = gcc
ifndef DEBUG
DEBUG = 0
endif
# 1 is the identifier for windows, 0 for linux:
ifndef OSid
OSid = 1
endif
ifeq ($(DEBUG),1)
CFLAGS = -O0 -g -Wall -Wextra -pedantic -lm -std=c99
else ifeq ($(DEBUG),2)
CFLAGS = -O0 -g -Wall -Wextra -pedantic -lm -std=c99 -fprofile-arcs -ftest-coverage
else
CFLAGS = -O3 -lm -std=c99
endif
OBJECTS = Main.o allocer.o nonlin_fit.o optic.o msg.o ff.o
GPF = Main.gcno allocer.gcno nonlin_fit.gcno optic.gcno msg.gcno ff.gcno
MIN: $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $(OBJECTS)
ifeq ($(OSid),1)
@echo.
else
@echo
endif
@echo make done
# build object files:
%.o: %.c
$(CC) $(CFLAGS) -c $<
clean:
ifeq ($(OSid),1)
del $(OBJECTS)
ifeq ($(DEBUG),2)
del $(GPF)
endif
@echo.
@echo cleaned
else
rm $(OBJECTS)
ifeq ($(DEBUG),2)
rm $(GPF)
endif
@echo
@echo cleaned
endif