1 ###########################################################################
4 # Copyright (C) 2006-2010
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.
21 ###########################################################################
27 BUILD_DIR
= .build
/$(shell echo
$(MODE
) | tr
[[:upper
:]] [[:lower
:]])
28 GNATMAKE_OPTIONS
= -XPRJ_BUILD
=$(MODE
)
38 GNATMAKE
= gnat make
$(GNATMAKE_OPTIONS
) -p
39 GNATCLEAN
= gnat
clean $(GNATMAKE_OPTIONS
)
40 GNATCHECK
= gnat
check
43 APP
:= $(ADA_PROJECT_PATH
)
47 export PRJ_BUILD
=$(OPB
)
49 ifeq ($(OS
),Windows_NT
)
50 export ADA_PROJECT_PATH
=$(PWD
)/external-libs
/morzhol\
;${APP}
51 export PATH
=$(PWD
)/lib
:$(PWD
)/external-libs
/morzhol
/$(B_DIR
)/lib
:$(OPATH
)
53 export ADA_PROJECT_PATH
=$(PWD
)/external-libs
/morzhol
:${APP}
56 GNAT_ROOT
= $(dir $(shell which gnatls
))..
59 prefix = $(shell cat
$(BUILD_DIR
)/gnat.root
2>/dev
/null
)
66 BLD_GPR
:= $(addprefix bld-
, $(GPR
))
67 CLN_GPR
:= $(addprefix cln-
, $(GPR
))
68 CHK_GPR
:= $(addprefix chk-
, $(GPR
))
79 all:: prepare_install bld-gnadelite
82 # Aliases or dummy target
88 regtests
: bld-tests
/regtests
89 @
(cd tests
; printf
't1... '; \
90 if
test `$(RUNTEST) $(BUILD_DIR)/obj/t1 | wc -l` = "10"; then \
95 @
(cd tests
; printf
't2... '; \
96 case
`$(RUNTEST) $(BUILD_DIR)/obj/t2` in \
104 @
(cd tests
; printf
't3... '; \
105 if
test `$(RUNTEST) $(BUILD_DIR)/obj/t3` = "OK"; then \
113 I_BIN
= $(prefix)/bin
114 I_INC
= $(prefix)/include/gnadelite
115 I_INC_G
= $(prefix)/include/gnadelite
/gnade
116 I_LIB
= $(prefix)/lib
/gnadelite
117 I_GPR
= $(prefix)/lib
/gnat
120 ifeq ("$(prefix)", "")
121 $(error
"Wrong install path : empty prefix var")
125 $(RM
) -f
$(I_GPR
)/gnadelite.gpr
127 install_dirs
: install_clean
134 ifeq ("$(INSTALL)", "..")
135 # IF GNAT_ROOT is empty and INSTALL var is not set by the user,
136 # the INSTALL var is equal to ".."
137 # In this case, read INSTALL from mk.install. This file is created
139 install: INSTALL
= $(shell cat mk.
install)
142 install: install_dirs
143 $(CP
) src
/*.ad
[sb
] $(I_INC
)
144 $(CP
) $(BUILD_DIR
)/obj
/*.ali
$(I_LIB
)
145 $(CP
) $(BUILD_DIR
)/lib
/*$(SOEXT
) $(I_LIB
)
146 $(CP
) gpr
/*.gpr
$(I_GPR
)
147 ifeq ($(OS
), Windows_NT
)
148 $(CP
) $(I_LIB
)/*$(SOEXT
) $(I_LIB
)/..
152 $(MKDIR
) $(BUILD_DIR
)
153 $(shell echo
$(GNAT_ROOT
) > $(BUILD_DIR
)/gnat.root
)