From 48dbbfaa243af0fa8a6de08d38f9e4a41b63d671 Mon Sep 17 00:00:00 2001 From: GruelingPine185 <66073333+GruelingPine185@users.noreply.github.com> Date: Fri, 23 Sep 2022 18:22:42 -0400 Subject: [PATCH] build repl --- repl/makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repl/makefile b/repl/makefile index 3bd4970..b3ddf7c 100644 --- a/repl/makefile +++ b/repl/makefile @@ -7,11 +7,16 @@ LIBS+=-ltoy ODIR = obj SRC = $(wildcard *.c) OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o)) - +OUTNAME=toy OUT=../$(TOY_OUTDIR)/toyrepl all: $(OBJ) +ifeq ($(shell uname),Darwin) + cp $(PWD)/$(TOY_OUTDIR)/lib$(OUTNAME).dylib /usr/local/lib/ + $(CC) -DTOY_IMPORT $(CFLAGS) -o $(OUT) $(OBJ) $(LIBS) +else $(CC) -DTOY_IMPORT $(CFLAGS) -o $(OUT) $(OBJ) -L$(realpath $(shell pwd)/../$(TOY_OUTDIR)) $(LIBS) +endif $(OBJ): | $(ODIR) @@ -25,3 +30,4 @@ $(ODIR)/%.o: %.c clean: $(RM) $(ODIR) + rm /usr/local/lib/lib$(OUTNAME).dylib