From 0b57f7efe73c8382653abf82715a265a15bff4fe Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Wed, 16 Nov 2022 22:05:47 +0000 Subject: [PATCH] Added release build targets, because bored --- makefile | 15 +++++++++++++++ repl/makefile | 3 +++ source/makefile | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/makefile b/makefile index bccf86b..56ecbd9 100644 --- a/makefile +++ b/makefile @@ -5,18 +5,33 @@ export TOY_OUTDIR = out all: $(TOY_OUTDIR) repl +#repl builds repl: $(TOY_OUTDIR) library $(MAKE) -C repl repl-static: $(TOY_OUTDIR) static $(MAKE) -C repl +repl-release: clean $(TOY_OUTDIR) library-release + $(MAKE) -C repl release + +repl-static-release: clean $(TOY_OUTDIR) static-release + $(MAKE) -C repl release + +#lib builds library: $(TOY_OUTDIR) $(MAKE) -j8 -C source library static: $(TOY_OUTDIR) $(MAKE) -j8 -C source static +library-release: $(TOY_OUTDIR) + $(MAKE) -j8 -C source library-release + +static-release: $(TOY_OUTDIR) + $(MAKE) -j8 -C source static-release + +#utils test: clean $(TOY_OUTDIR) $(MAKE) -C test diff --git a/repl/makefile b/repl/makefile index 640ef56..533207a 100644 --- a/repl/makefile +++ b/repl/makefile @@ -18,6 +18,9 @@ else $(CC) -DTOY_IMPORT $(CFLAGS) -o $(OUT) $(OBJ) -Wl,-rpath,. -L$(realpath $(shell pwd)/../$(TOY_OUTDIR)) $(LIBS) endif +release: all + strip $(OUT) + $(OBJ): | $(ODIR) $(ODIR): diff --git a/source/makefile b/source/makefile index 667538c..d609f3e 100644 --- a/source/makefile +++ b/source/makefile @@ -34,6 +34,12 @@ library: $(OBJ) static: $(OBJ) ar crs ../$(TOY_OUTDIR)/lib$(OUTNAME).a $(OBJ) +library-release: $(OBJ) library + strip $(OUT) + +static-release: $(OBJ) static + strip -d ../$(TOY_OUTDIR)/lib$(OUTNAME).a + $(OBJ): | $(ODIR) $(ODIR):