blob: 5ed32db36b1a6f5f85c00e41b8871b38abddbe61 [file] [log] [blame]
Austin Schuh16ce3c72018-01-28 16:17:08 -08001###################################################################################################
2# #
3# This file is part of HPIPM. #
4# #
5# HPIPM -- High Performance Interior Point Method. #
6# Copyright (C) 2017 by Gianluca Frison. #
7# Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. #
8# All rights reserved. #
9# #
10# HPMPC is free software; you can redistribute it and/or #
11# modify it under the terms of the GNU Lesser General Public #
12# License as published by the Free Software Foundation; either #
13# version 2.1 of the License, or (at your option) any later version. #
14# #
15# HPMPC is distributed in the hope that it will be useful, #
16# but WITHOUT ANY WARRANTY; without even the implied warranty of #
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
18# See the GNU Lesser General Public License for more details. #
19# #
20# You should have received a copy of the GNU Lesser General Public #
21# License along with HPMPC; if not, write to the Free Software #
22# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #
23# #
24# Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de #
25# #
26###################################################################################################
27
28include ./Makefile.rule
29
30OBJS =
31
32ifeq ($(TARGET), GENERIC)
33OBJS +=
34endif
35
36# dense qp
37OBJS += dense_qp/d_dense_qp.o dense_qp/d_dense_qp_sol.o dense_qp/d_dense_qp_kkt.o dense_qp/d_dense_qp_ipm_hard.o
38OBJS += dense_qp/s_dense_qp.o dense_qp/s_dense_qp_sol.o dense_qp/s_dense_qp_kkt.o dense_qp/s_dense_qp_ipm_hard.o
39# ocp qp
40OBJS += ocp_qp/d_ocp_qp.o ocp_qp/d_ocp_qp_sol.o ocp_qp/d_ocp_qp_kkt.o ocp_qp/d_ocp_qp_ipm_hard.o
41OBJS += ocp_qp/s_ocp_qp.o ocp_qp/s_ocp_qp_sol.o ocp_qp/s_ocp_qp_kkt.o ocp_qp/s_ocp_qp_ipm_hard.o
42OBJS += ocp_qp/m_ocp_qp.o ocp_qp/m_ocp_qp_kkt.o ocp_qp/m_ocp_qp_ipm_hard.o
43# core qp
44OBJS += core_qp/d_core_qp_ipm_hard_aux.o core_qp/d_core_qp_ipm_hard.o
45OBJS += core_qp/s_core_qp_ipm_hard_aux.o core_qp/s_core_qp_ipm_hard.o
46# cond
47OBJS += cond/d_cond_aux.o cond/d_cond.o cond/d_part_cond.o
48
49all: clean static_library
50
51static_library: target
52 ( cd cond; $(MAKE) obj)
53 ( cd core_qp; $(MAKE) obj)
54 ( cd dense_qp; $(MAKE) obj)
55 ( cd ocp_qp; $(MAKE) obj)
56 ar rcs libhpipm.a $(OBJS)
57 cp libhpipm.a ./lib/
58 @echo
59 @echo " libhpipm.a static library build complete."
60 @echo
61
62shared_library: target
63 ( cd cond; $(MAKE) obj)
64 ( cd core_qp; $(MAKE) obj)
65 ( cd dense_qp; $(MAKE) obj)
66 ( cd ocp_qp; $(MAKE) obj)
67 gcc -shared -o libhpipm.so $(OBJS)
68 cp libhpipm.so ./lib/
69 @echo
70 @echo " libhpipm.so shared library build complete."
71 @echo
72
73target:
74 touch ./include/hpipm_target.h
75ifeq ($(TARGET), GENERIC)
76 echo "#ifndef TARGET_GENERIC" > ./include/hpipm_target.h
77 echo "#define TARGET_GENERIC" >> ./include/hpipm_target.h
78 echo "#endif" >> ./include/hpipm_target.h
79endif
80
81install_static:
82 mkdir -p $(PREFIX)/hpipm
83 mkdir -p $(PREFIX)/hpipm/lib
84 cp -f libhpipm.a $(PREFIX)/hpipm/lib/
85 mkdir -p $(PREFIX)/hpipm/include
86 cp -f ./include/*.h $(PREFIX)/hpipm/include/
87
88install_shared:
89 mkdir -p $(PREFIX)/hpipm
90 mkdir -p $(PREFIX)/hpipm/lib
91 cp -f libhpipm.so $(PREFIX)/hpipm/lib/
92 mkdir -p $(PREFIX)/hpipm/include
93 cp -f ./include/*.h $(PREFIX)/hpipm/include/
94
95test_problem:
96 cp libhpipm.a ./test_problems/libhpipm.a
97 make -C test_problems obj
98 @echo
99 @echo " Test problem build complete."
100 @echo
101
102run:
103 ./test_problems/test.out
104
105clean:
106 rm -f libhpipm.a
107 rm -f libhpipm.so
108 rm -f ./lib/libhpipm.a
109 rm -f ./lib/libhpipm.so
110 make -C cond clean
111 make -C core_qp clean
112 make -C dense_qp clean
113 make -C ocp_qp clean
114 make -C test_problems clean
115