From 86fcdc4fba39d48bf3537b350bab7ff7abf62f88 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Sun, 10 Jan 2016 10:45:15 -0800 Subject: [PATCH] Refactor some gprbuild bits out --- Makefile | 4 ++-- pipeline.gpr | 15 +++++++-------- shared.gpr | 13 +++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 shared.gpr diff --git a/Makefile b/Makefile index 92c4417..b722ba2 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ EXECUTABLE=build/pipeline all: $(EXECUTABLE) clean: - $(GPRCLEAN) + $(GPRCLEAN) -Ppipeline check: all build/c_pipeline ./t/bin/bats ./t/*.bats @@ -14,7 +14,7 @@ check: all build/c_pipeline generated: build/generated/nanomsg_nn_h.ads build/pipeline: generated - $(GPRBUILD) + $(GPRBUILD) -Ppipeline build/c_pipeline: contrib/pipeline.c $(CC) -lnanomsg -o build/c_pipeline contrib/pipeline.c diff --git a/pipeline.gpr b/pipeline.gpr index 0d14166..f784e9c 100644 --- a/pipeline.gpr +++ b/pipeline.gpr @@ -1,13 +1,12 @@ +with "shared"; project Pipeline is - for Source_Dirs use (".", "build/generated"); - for Main use ("pipeline.adb"); - for Object_Dir use "build"; - for Exec_Dir use "build"; + for Main use ("pipeline.adb"); - package Compiler is - for Default_Switches("ada") use - ("-g", "-gnateS", "-ftest-coverage", "-gnatv", "-gnatf", "-gnatyabcefhiklmnprst", "-gnat12"); - end Compiler; + for Source_Dirs use Shared'Source_Dirs; + for Object_Dir use Shared'Object_Dir; + for Exec_Dir use Shared'Exec_Dir; + + package Compiler renames Shared.Compiler; end Pipeline; diff --git a/shared.gpr b/shared.gpr new file mode 100644 index 0000000..355a91b --- /dev/null +++ b/shared.gpr @@ -0,0 +1,13 @@ +abstract project Shared is + for Source_Files use (); -- no source files! + for Source_Dirs use (".", "build/generated"); + for Object_Dir use "build"; + for Exec_Dir use "build"; + + package Compiler is + for Default_Switches("ada") use + ("-g", "-gnateS", "-ftest-coverage", + "-gnatv", "-gnatf", "-gnatyabcefhiklmnprst", + "-gnat12"); + end Compiler; +end Shared;