Victor Porton
2017-07-05 16:46:19 UTC
I have the below Makefile.am
As you see, I don't want to use Automake's Ada language support,
but want to create my own rules for building Ada libraries (because
I want consistent behavior in make and in my IDE which uses gnatmake
and because I don't want to manually specify the list of Ada source
files).
The trouble is that my "all:" rules is not built when I run "make all".
How to add my own rules for building lib/librdf-ada.so and
lib/librdf-ada.a?
#################################
soversion = 2.0.14
soname = librdf-ada.so.$(soversion)
ADAINCLUDE = $(includedir)/librdf
ADALIB = $(libdir)/librdf
LIB_DIR = $(srcdir)/lib
lib/librdf-ada.so:
gnatmake -p -Plibrdf.gpr \
-XLIBRARY_KIND=dynamic -XOBJ_DIR=$(builddir)/obj
-Xsoversion=$(soname) -XMODE=Install
lib/librdf-ada.a:
gnatmake -p -Plibrdf.gpr \
-XLIBRARY_KIND=static -XOBJ_DIR=$(builddir)/obj
-Xsoversion=$(soname) -XMODE=Install
all: $(LIB_DIR)/librdf-ada.so $(LIB_DIR)/librdf-ada.a
clean:
gnat clean -r -Plibrdf.gpr -XLIBRARY_KIND=dynamic
-XOBJ_DIR=$(builddir)/obj -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Plibrdf.gpr -XLIBRARY_KIND=static
-XOBJ_DIR=$(builddir)/obj -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Ptest.gpr -XLIBRARY_KIND=dynamic
-XOBJ_DIR=$(builddir)/obj/test -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Ptest.gpr -XLIBRARY_KIND=static
-XOBJ_DIR=$(builddir)/obj/test -Xsoversion=$(soname) -XMODE=Install
rm -f $(builddir)/lib/$(soname)
install: all
mkdir -p $(ADAINCLUDE)
mkdir -p $(ADALIB)
mkdir -p $(libdir)
cd $(srcdir)/src && $(INSTALL_DATA) *.ads *.adb $(ADAINCLUDE)
cd $(builddir)/ali && $(INSTALL_DATA) *.ali $(ADALIB)
$(INSTALL_DATA) lib/librdf-ada.so lib/librdf-ada.a $(soname)
$(libdir)
uninstall:
rm -rf $(ADAINCLUDE)
rm -rf $(ADALIB)
cd $(builddir)/lib && rm -f librdf-ada.so librdf-ada.a
$(soname)
.PHONY: all clean install uninstall
As you see, I don't want to use Automake's Ada language support,
but want to create my own rules for building Ada libraries (because
I want consistent behavior in make and in my IDE which uses gnatmake
and because I don't want to manually specify the list of Ada source
files).
The trouble is that my "all:" rules is not built when I run "make all".
How to add my own rules for building lib/librdf-ada.so and
lib/librdf-ada.a?
#################################
soversion = 2.0.14
soname = librdf-ada.so.$(soversion)
ADAINCLUDE = $(includedir)/librdf
ADALIB = $(libdir)/librdf
LIB_DIR = $(srcdir)/lib
lib/librdf-ada.so:
gnatmake -p -Plibrdf.gpr \
-XLIBRARY_KIND=dynamic -XOBJ_DIR=$(builddir)/obj
-Xsoversion=$(soname) -XMODE=Install
lib/librdf-ada.a:
gnatmake -p -Plibrdf.gpr \
-XLIBRARY_KIND=static -XOBJ_DIR=$(builddir)/obj
-Xsoversion=$(soname) -XMODE=Install
all: $(LIB_DIR)/librdf-ada.so $(LIB_DIR)/librdf-ada.a
clean:
gnat clean -r -Plibrdf.gpr -XLIBRARY_KIND=dynamic
-XOBJ_DIR=$(builddir)/obj -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Plibrdf.gpr -XLIBRARY_KIND=static
-XOBJ_DIR=$(builddir)/obj -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Ptest.gpr -XLIBRARY_KIND=dynamic
-XOBJ_DIR=$(builddir)/obj/test -Xsoversion=$(soname) -XMODE=Install
gnat clean -r -Ptest.gpr -XLIBRARY_KIND=static
-XOBJ_DIR=$(builddir)/obj/test -Xsoversion=$(soname) -XMODE=Install
rm -f $(builddir)/lib/$(soname)
install: all
mkdir -p $(ADAINCLUDE)
mkdir -p $(ADALIB)
mkdir -p $(libdir)
cd $(srcdir)/src && $(INSTALL_DATA) *.ads *.adb $(ADAINCLUDE)
cd $(builddir)/ali && $(INSTALL_DATA) *.ali $(ADALIB)
$(INSTALL_DATA) lib/librdf-ada.so lib/librdf-ada.a $(soname)
$(libdir)
uninstall:
rm -rf $(ADAINCLUDE)
rm -rf $(ADALIB)
cd $(builddir)/lib && rm -f librdf-ada.so librdf-ada.a
$(soname)
.PHONY: all clean install uninstall