Avoid recursive reference to ADA_PROJECT_PATH
[gnadelite.git] / makefile
blob635fdd43641ff5f29b0f7e5a0bd4077886c5c338
1 ###########################################################################
2 # GnadeLite
4 # Copyright (C) 2006-2007
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 # Simple makefile to build Vision2Pixels
22 ###########################################################################
24 include mk.config
26 B_DIR=".build/$(shell echo $(MODE) | tr [[:upper:]] [[:lower:]])"
28 APP := $(ADA_PROJECT_PATH)
30 ifeq ($(OS),Windows_NT)
31 export ADA_PROJECT_PATH=$PWD/external-libs/morzhol\;${APP}
32 else
33 export ADA_PROJECT_PATH=$PWD/external-libs/morzhol:${APP}
34 endif
36 all: build
38 build:
39 ifneq ($(INSTALL), "")
40 # Write INSTALL target into mk.install (see install target)
41 $(shell echo $(INSTALL) > mk.install)
42 endif
43 $(GNATMAKE) -Pgnadelite
45 clean:
46 $(GNATCLEAN) -Pgnadelite
48 I_BIN = $(INSTALL)/bin
49 I_INC = $(INSTALL)/include/gnadelite
50 I_INC_G = $(INSTALL)/include/gnadelite/gnade
51 I_LIB = $(INSTALL)/lib/gnadelite
52 I_GPR = $(INSTALL)/lib/gnat
54 install_clean:
55 ifeq ("$(INSTALL)", "")
56 $(error "Wrong install path : empty INSTALL var")
57 endif
58 $(RM) -fr $(I_INC)
59 $(RM) -fr $(I_LIB)
60 $(RM) -f $(I_GPR)/gnadelite.gpr
62 install_dirs: install_clean
63 $(MKDIR) $(I_BIN)
64 $(MKDIR) $(I_INC)
65 $(MKDIR) $(I_INC_G)
66 $(MKDIR) $(I_LIB)
67 $(MKDIR) $(I_GPR)
69 ifeq ("$(INSTALL)", "..")
70 # IF GNAT_ROOT is empty and INSTALL var is not set by the user,
71 # the INSTALL var is equal to ".."
72 # In this case, read INSTALL from mk.install. This file is created
73 # before building
74 install: INSTALL = $(shell cat mk.install)
75 endif
77 install: install_dirs
78 $(CP) src/*.ad[sb] $(I_INC)
79 $(CP) gnade_src/*.ad[sb] $(I_INC_G)
80 $(CP) lib/*.ali $(I_LIB)
81 $(CP) lib/*$(SOEXT) $(I_LIB)
82 $(CP) gpr/*.gpr $(I_GPR)
83 ifeq ($(OS), Windows_NT)
84 $(CP) $(I_LIB)/*$(SOEXT) $(I_LIB)/..
85 endif