-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 872 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
CC = gcc
OFILES = mpfit.o
LIBFILE = libmpfit.a
CFLAGS = -Wall -Werror -Wextra -pedantic -Wno-unused -DTIMEIT
EXEC =
ifeq ($(OS), Windows_NT)
RM = del /s /f
RM_SUFFIX =
# This is more of a shell function requirement than an OS
else
RM = find . -type f -name
RM_SUFFIX = -delete
EXEC = ./
endif
all: $(LIBFILE) testmpfit testmpfit_jac test
test:
$(EXEC)testmpfit
$(EXEC)testmpfit_jac
clean:
$(RM) $(OFILES) $(RM_SUFFIX)
$(RM) "*.exe" $(RM_SUFFIX)
$(RM) "*.a" $(RM_SUFFIX)
$(RM) "testmpfit" $(RM_SUFFIX)
$(RM) "testmpfit_jac" $(RM_SUFFIX)
# $(RM) "*.dll" $(RM_SUFFIX)
mpfit.o: clmfit.c mpfit.h
$(CC) $(CFLAGS) -c -o $@ $<
$(LIBFILE): $(OFILES)
$(AR) r $@ $(OFILES)
testmpfit: testmpfit.c libmpfit.a
$(CC) $(CFLAGS) testmpfit.c -o $@ -L. -lmpfit -lm
testmpfit_jac: testmpfit_jac.c libmpfit.a
$(CC) $(CFLAGS) testmpfit_jac.c -o $@ -L. -lmpfit -lm