1 ##############################################################################
4 ## Copyright (C) 2007-2008 ##
5 ## Pascal Obry - Olivier Ramonat ##
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. ##
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. ##
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 ##############################################################################
27 BUILD_DIR
= .build
/$(shell echo
$(MODE
) | tr
[[:upper
:]] [[:lower
:]])
28 GNATMAKE_OPTIONS
= -XPRJ_BUILD
=$(MODE
)
33 GNAT_ROOT
= $(dir $(shell which gnatls
))..
38 prefix = $(shell cat
$(BUILD_DIR
)/gnat.root
2>/dev
/null
)
41 ifeq (,$(ARGWIAD_ROOT
))
42 ARGWIAD_ROOT
= $(shell echo
$$ARGWIAD_ROOT)
46 GNATMAKE
= $(GNAT
) make
-p
-j
$(JOBS
) $(GNATMAKE_OPTIONS
)
47 GNATCLEAN
= $(GNAT
) clean $(GNATMAKE_OPTIONS
)
48 GNATCHECK
= $(GNAT
) check $(GNATMAKE_OPTIONS
) -rules
-from
=morzhol.
check
61 BLD_GPR
:= $(addprefix bld-
, $(GPR
))
62 CLN_GPR
:= $(addprefix cln-
, $(GPR
))
63 CHK_GPR
:= $(addprefix chk-
, $(GPR
))
65 ifeq (${OS},Windows_NT
)
68 export PATH
:=$(shell pwd
)/lib
:$(PATH
) # Required to find the shared library
73 VERSION_ALL
= $(shell git describe
2>/dev
/null
)
84 morzhol build
: prepare_install bld-morzhol
86 all:: prepare_install
$(LIBRARIES
)
91 $(RM
) -rf
$(BUILD_DIR
)
93 regtests
:: bld-test
/test
100 $(MKDIR
) $(prefix)/include/morzhol
101 $(MKDIR
) $(prefix)/lib
/morzhol
102 $(MKDIR
) $(prefix)/lib
/gnat
103 $(CP
) src
/*.ad
[sb
] $(prefix)/include/morzhol
104 $(CP
) $(BUILD_DIR
)/lib
/*$(LIBEXT
) $(prefix)/lib
/morzhol
105 $(CP
) $(BUILD_DIR
)/lib
/*.ali
$(prefix)/lib
/morzhol
106 $(CP
) install.gpr
$(prefix)/lib
/gnat
/morzhol.gpr
107 ifeq ($(OS
), Windows_NT
)
108 $(CP
) $(BUILD_DIR
)/lib
/*$(LIBEXT
) $(prefix)/bin
112 $(MKDIR
) $(BUILD_DIR
)
113 echo
$(GNAT_ROOT
) > $(BUILD_DIR
)/gnat.root
116 $(RM
) -rf
$(prefix)/include/morzhol
117 $(RM
) -rf
$(prefix)/lib
/morzhol
120 git archive
--prefix="$(shell basename $(PWD))/" --format
=tar HEAD \
121 | gzip
> "$(shell basename $(PWD))-$(VERSION_ALL)-src.tgz"