From: Reto Buerki Date: Mon, 13 Feb 2012 15:34:17 +0000 (+0100) Subject: Add library project file X-Git-Tag: v0.1~3 X-Git-Url: https://git.codelabs.ch/?p=cuda-ada.git;a=commitdiff_plain;h=2fc56cf41d3e5b295f0e682dbb0898e42bc0e5ef Add library project file --- diff --git a/.gitignore b/.gitignore index 8cb6c40..dfcc407 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.lyx~ *.pdf +lib obj cache diff --git a/Makefile b/Makefile index 10834e8..000307d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CUDASDK = /usr/local/cuda OBJDIR = obj +LIBDIR = lib COVDIR = $(OBJDIR)/cov PERFDIR = perf @@ -16,7 +17,14 @@ VERSION = $(MAJOR).$(MINOR) CUDA_ADA = libcudaada-$(VERSION) TARBALL = $(CUDA_ADA).tar.bz2 -all: build_examples +SO_LIBRARY = libcudaada.so.$(VERSION) +LIBRARY_KIND = dynamic + +all: build_lib + +build_lib: + @LIBRARY_PATH=$(LIBRARY_PATH) gnatmake -p -Pcuda_lib \ + -XARCH=$(ARCH) -XVERSION="$(VERSION)" -XLIBRARY_KIND="$(LIBRARY_KIND)" build_examples: @LIBRARY_PATH=$(LIBRARY_PATH) gnatmake -p -Pcuda_examples -XARCH=$(ARCH) @@ -58,10 +66,11 @@ $(OBJDIR)/perf_c_drv: $(PERFDIR)/perf_c_drv.c clean: @rm -rf cache @rm -rf $(OBJDIR) + @rm -rf $(LIBDIR) $(MAKE) -C doc clean dist: @echo "Creating release tarball $(TARBALL) ... " @git archive --format=tar HEAD --prefix $(CUDA_ADA)/ | bzip2 > $(TARBALL) -.PHONY: all build_tests build_examples clean dist doc perf tests +.PHONY: all build_examples build_lib build_tests clean dist doc perf tests diff --git a/cuda_common.gpr b/cuda_common.gpr index fd21ec3..f4282a7 100644 --- a/cuda_common.gpr +++ b/cuda_common.gpr @@ -24,6 +24,8 @@ project Cuda_Common is for Source_Dirs use (); + Version := external ("VERSION", "unknown"); + Compiler_Switches := ("-gnatygAdISuxo", "-gnatVa", "-gnat05", diff --git a/cuda_lib.gpr b/cuda_lib.gpr new file mode 100644 index 0000000..cf85461 --- /dev/null +++ b/cuda_lib.gpr @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2011, 2012 Reto Buerki +-- Copyright (C) 2011, 2012 Adrian-Ken Rueegsegger +-- University of Applied Sciences Rapperswil +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- + +with "cuda_common"; + +project Cuda_Lib is + + for Source_Dirs use ("src"); + for Object_Dir use "obj/lib"; + for Library_Name use "cudaada"; + for Library_Dir use "lib"; + for Library_Kind use external ("LIBRARY_KIND", "dynamic"); + for Library_Version use "libcudaada.so." & Cuda_Common.Version; + for Library_Options use Cuda_Common.Linker_Switches; + + Compiler_Switches := Cuda_Common.Compiler_Switches & "-gnatwale"; + + package Compiler is + for Default_Switches ("ada") use Compiler_Switches; + end Compiler; + + package Binder is + for Default_Switches ("ada") use ("-E"); + end Binder; + +end Cuda_Lib;