Add missing INSTALL setting in makefile.
[morzhol.git] / makefile
blob7d4b13d8e2dce0b6ea849f9536ade9a6ad397c5d
1 ##############################################################################
2 ## Morzhol ##
3 ## ##
4 ## Copyright (C) 2007 ##
5 ## Pascal Obry - Olivier Ramonat ##
6 ## ##
7 ## This library is free software; you can redistribute it and/or modify ##
8 ## it under the terms of the GNU General Public License as published by ##
9 ## the Free Software Foundation; either version 2 of the License, or (at ##
10 ## your option) any later version. ##
11 ## ##
12 ## This library is distributed in the hope that it will be useful, but ##
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of ##
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ##
15 ## General Public License for more details. ##
16 ## ##
17 ## You should have received a copy of the GNU General Public License ##
18 ## along with this library; if not, write to the Free Software Foundation, ##
19 ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ##
20 ##############################################################################
22 GNAT=gnat
23 MKDIR=mkdir
24 CP=cp
25 MODE=Release
26 GNAT_ROOT=$(dir $(shell which gnatls))..
27 INSTALL = $(GNAT_ROOT)
29 # Required for Windows to find the shared library
30 ifeq ($(OS),Windows_NT)
31 export PATH:=$(shell pwd)/lib:$(PATH)
32 endif
34 all:
35 $(GNAT) make -p -XPRJ_BUILD=$(MODE) -Pmorzhol
37 setup:
39 check:
40 $(GNAT) check -dd -Pmorzhol -rules -from=morzhol.check
42 regtests:
43 $(GNAT) make -Ptest/test
44 ./test/test
46 clean:
47 -$(GNAT) clean -XPRJ_BUILD=$(MODE) -q -Pmorzhol
48 -$(GNAT) clean -XPRJ_BUILD=$(MODE) -q -Ptest/test
50 I_MORZ = $(INSTALL)/include/morzhol
51 I_LIB_MORZ = $(INSTALL)/lib/morzhol
52 I_GPR = $(INSTALL)/lib/gnat
53 BDIR = ".build/$(shell echo $(MODE) | tr [[:upper:]] [[:lower:]])"
55 install:
56 ifeq ("$(INSTALL)", "..")
57 $(error "Wrong install path : INSTALL='$(INSTALL)'")
58 else
59 ifeq ("$(INSTALL)", "")
60 $(error "Wrong install path : empty INSTALL var")
61 endif
62 endif
63 $(MKDIR) -p $(I_MORZ)
64 $(CP) src/*.ad[sb] $(I_MORZ)
65 $(CP) $(BDIR)/lib/* $(I_LIB_MORZ)
66 $(CP) install.gpr $(I_GPR)/morzhol.gpr