Improve OS.Compose implementation to take into account ./ in path.
[morzhol.git] / makefile
blob4d7d020b5a779feaf3578f20db3015860933c52c
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
27 GNAT_ROOT=$(dir $(shell which gnatls))..
28 INSTALL = $(GNAT_ROOT)
30 # Required for Windows to find the shared library
31 ifeq ($(OS),Windows_NT)
32 export PATH:=$(shell pwd)/lib:$(PATH)
33 endif
35 all: build
37 build:
38 ifneq ($(INSTALL), "")
39 # Write INSTALL target into mk.install (see install target)
40 $(shell echo INSTALL = $(INSTALL) > mk.install)
41 endif
42 $(GNAT) make -p -XPRJ_BUILD=$(MODE) -Pmorzhol
44 setup:
46 check:
47 $(GNAT) check -dd -Pmorzhol -rules -from=morzhol.check
49 regtests:
50 $(GNAT) make -p -Ptest/test
51 ./test/test
52 ./test/test_compose
54 clean:
55 -$(GNAT) clean -XPRJ_BUILD=$(MODE) -q -Pmorzhol
56 -$(GNAT) clean -XPRJ_BUILD=$(MODE) -q -Ptest/test
59 -include mk.install
61 force:
63 # Set BDIR to .build/#lowercase_mode#
64 install: BDIR = .build/$(shell echo $(MODE) | tr [[:upper:]] [[:lower:]])
65 install: force
66 ifeq ("$(INSTALL)", "")
67 $(error "Wrong install path : empty INSTALL var")
68 endif
69 $(MKDIR) -p $(INSTALL)/include/morzhol
70 $(CP) src/*.ad[sb] $(INSTALL)/include/morzhol
71 $(CP) $(BDIR)/lib/* $(INSTALL)/lib/morzhol
72 $(CP) install.gpr $(INSTALL)/lib/gnat/morzhol.gpr
73 ifeq ($(OS), Windows_NT)
74 $(CP) $(BDIR)/lib/*$(SOEXT) $(INSTALL)/lib
75 endif