Add new test t2
[gnadelite.git] / makefile
blob155e40cddcda917df184bd7bd2ae5ff927088ae6
1 ###########################################################################
2 # GnadeLite
4 # Copyright (C) 2006-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.
21 ###########################################################################
23 include mk.config
25 B_DIR=".build/$(shell echo $(MODE) | tr [[:upper:]] [[:lower:]])"
27 APP := $(ADA_PROJECT_PATH)
29 ifeq ($(OS),Windows_NT)
30 export ADA_PROJECT_PATH=$PWD/external-libs/morzhol\;${APP}
31 else
32 export ADA_PROJECT_PATH=$PWD/external-libs/morzhol:${APP}
33 endif
35 all: build
37 setup:
38 runtests:
39 (cd tests; $(GNATMAKE) -Pregtests;)
40 @(cd tests; printf 't1... '; \
41 if test `$(RUNTEST) ./t1 | wc -l` = "10"; then \
42 printf "ok\n"; \
43 else \
44 printf "nok\n"; \
45 fi;)
46 @(cd tests; printf 't2... '; \
47 if test `$(runtest) ./t2` = 1234; then \
48 printf "ok\n"; \
49 else \
50 printf "nok\n"; \
51 fi;)
53 build:
54 ifneq ($(INSTALL), "")
55 # Write INSTALL target into mk.install (see install target)
56 $(shell echo $(INSTALL) > mk.install)
57 endif
58 $(GNATMAKE) -Pgnadelite
60 clean:
61 $(GNATCLEAN) -Pgnadelite
63 I_BIN = $(INSTALL)/bin
64 I_INC = $(INSTALL)/include/gnadelite
65 I_INC_G = $(INSTALL)/include/gnadelite/gnade
66 I_LIB = $(INSTALL)/lib/gnadelite
67 I_GPR = $(INSTALL)/lib/gnat
69 install_clean:
70 ifeq ("$(INSTALL)", "")
71 $(error "Wrong install path : empty INSTALL var")
72 endif
73 $(RM) -fr $(I_INC)
74 $(RM) -fr $(I_LIB)
75 $(RM) -f $(I_GPR)/gnadelite.gpr
77 install_dirs: install_clean
78 $(MKDIR) $(I_BIN)
79 $(MKDIR) $(I_INC)
80 $(MKDIR) $(I_INC_G)
81 $(MKDIR) $(I_LIB)
82 $(MKDIR) $(I_GPR)
84 ifeq ("$(INSTALL)", "..")
85 # IF GNAT_ROOT is empty and INSTALL var is not set by the user,
86 # the INSTALL var is equal to ".."
87 # In this case, read INSTALL from mk.install. This file is created
88 # before building
89 install: INSTALL = $(shell cat mk.install)
90 endif
92 install: install_dirs
93 $(CP) src/*.ad[sb] $(I_INC)
94 $(CP) gnade_src/*.ad[sb] $(I_INC_G)
95 $(CP) lib/*.ali $(I_LIB)
96 $(CP) lib/*$(SOEXT) $(I_LIB)
97 $(CP) gpr/*.gpr $(I_GPR)
98 ifeq ($(OS), Windows_NT)
99 $(CP) $(I_LIB)/*$(SOEXT) $(I_LIB)/..
100 endif