From 1db574fa1f339f77999d3988251e13a266201083 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Jul 2019 21:25:36 -0500 Subject: build: add wrapper Makefile --- Makefile | 23 +++++++++++++++++++++++ bin/ed/ed.gpr | 10 ++++++++++ bin/stty/stty.gpr | 6 ++++++ later/ed.gpr | 12 ------------ userland.gpr | 11 +++++++++++ 5 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 Makefile create mode 100644 bin/ed/ed.gpr create mode 100644 bin/stty/stty.gpr delete mode 100644 later/ed.gpr create mode 100644 userland.gpr diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1d58eaf --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +INSTALL = install +YACC = byacc + +PROJECT = userland.gpr + +GENERATED = bin/expr/expr.c + +all: prepare + gprbuild -P $(PROJECT) -p + +clean: + gprclean -P $(PROJECT) -p + rm -f $(GENERATED) + +install: all + gprinstall -P $(PROJECT) -p --prefix=$(if $(DESTDIR),$(DESTDIR),/) + $(INSTALL) -Dm0755 usr.bin/false/false.sh $(DESTDIR)/usr/bin/false + $(INSTALL) -Dm0755 usr.bin/true/true.sh $(DESTDIR)/usr/bin/true + +prepare: $(GENERATED) + +.y.c: + $(YACC) -o $@ $< diff --git a/bin/ed/ed.gpr b/bin/ed/ed.gpr new file mode 100644 index 0000000..9ebfc3c --- /dev/null +++ b/bin/ed/ed.gpr @@ -0,0 +1,10 @@ +project ed extends "template/bin.gpr" is + + for Main use ("main"); + for Object_Dir use External ("BUILDROOT") & "/" & project'Name; + + package Builder is + for Executable ("main") use "ed"; + end Builder; + +end ed; diff --git a/bin/stty/stty.gpr b/bin/stty/stty.gpr new file mode 100644 index 0000000..d41143a --- /dev/null +++ b/bin/stty/stty.gpr @@ -0,0 +1,6 @@ +project stty extends "template/bin.gpr" is + + for Main use (project'Name); + for Object_Dir use External ("BUILDROOT") & "/" & project'Name; + +end stty; diff --git a/later/ed.gpr b/later/ed.gpr deleted file mode 100644 index ef7bf99..0000000 --- a/later/ed.gpr +++ /dev/null @@ -1,12 +0,0 @@ -project ed is - - for Languages use ("C"); - for Object_Dir use "obj"; - for Exec_Dir use "."; - for Main use ("main"); - - package Builder is - for Executable ("main.c") use "ed"; - end Builder; - -end ed; diff --git a/userland.gpr b/userland.gpr new file mode 100644 index 0000000..b26a28a --- /dev/null +++ b/userland.gpr @@ -0,0 +1,11 @@ +aggregate project Userland is + + for Create_Missing_Dirs use "true"; + for External ("BUILDROOT") use Userland'Project_Dir & "/build"; + for Project_Files use ("bin/**/*.gpr", "usr.bin/**/*.gpr"); + + package Builder is + for Switches (others) use ("-j" & External ("JOBS", "0"), "-s"); + end Builder; + +end Userland; -- cgit v1.2.3-70-g09d2