forked from embotech/ecos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecos.mk
63 lines (53 loc) · 1.44 KB
/
ecos.mk
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
53
54
55
56
57
58
59
60
61
62
63
# Makefile configuration for ECOS
# Whether to use Long or Int for index type
# comment it out to use ints
USE_LONG = 1
## Intel C Compiler
#CC = icc
#CFLAGS = -O3 -m64 -Wall -strict-ansi -DLDL_LONG -DDLONG
#LIBS = -lm
## GNU C Compiler
#CC = gcc
CFLAGS += -O2 -Wall -DCTRLC=1 -Wextra -fPIC #-ansi -Werror #-ipo
ifdef USE_LONG
CFLAGS += -DLDL_LONG -DDLONG
LDL = ldll.o
AMD = amd_l*.o amd_global.o
else
CFLAGS +=
LDL = ldl.o
AMD = amd_i*.o amd_global.o
endif
UNAME := $(shell uname)
ifeq (CYGWIN, $(findstring CYGWIN, $(UNAME)))
ISWINDOWS := 1
else ifeq (MINGW, $(findstring MINGW, $(UNAME)))
ISWINDOWS := 1
else ifeq (MSYS, $(findstring MSYS, $(UNAME)))
ISWINDOWS := 1
else
ISWINDOWS := 0
endif
ifeq ($(UNAME), Darwin)
# we're on apple, no need to link rt library
LDFLAGS = -lm
# shared library has extension .dylib
SHAREDNAME = libecos.dylib
else ifeq ($(ISWINDOWS), 1)
# we're on windows (cygwin or msys)
LDFLAGS = -lm
# shared library has extension .dll
SHAREDNAME = libecos.dll
else
# we're on a linux system, use accurate timer provided by clock_gettime()
LDFLAGS = -lm -lrt
# shared library has extension .so
SHAREDNAME = libecos.so
endif
## AR and RANLIB FOR GENERATING LIBRARIES
AR = ar
ARFLAGS = rcs
ARCHIVE = $(AR) $(ARFLAGS)
RANLIB = ranlib
## WHICH FILES TO CLEAN UP
CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d *.gcda *.gcno libecos*.a libecos*.so libecos*.dylib libecos*.dll ecos_bb_test ecostester ecostester.exe runecosexp