Skip to content

Commit

Permalink
Enable choice of library version for shell
Browse files Browse the repository at this point in the history
Default behavior is unchanged, but enables to chose the dynamic version by
passing "libmujs=libmujs.so" to make.
  • Loading branch information
ismaell authored and ccxvii committed Oct 17, 2022
1 parent 1138515 commit d592c78
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ $(OUT)/libmujs.$(SO_EXT): one.c $(HDRS)
@ mkdir -p $(@D)
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $< -lm

$(OUT)/mujs: $(OUT)/libmujs.o $(OUT)/main.o
libmujs ?= libmujs.a

$(OUT)/mujs: $(OUT)/main.o $(OUT)/$(libmujs)
@ mkdir -p $(@D)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBREADLINE) -lm
$(CC) $(LDFLAGS) -o $@ $< -L$(OUT) -l:$(libmujs) $(LIBREADLINE) -lm

$(OUT)/mujs-pp: $(OUT)/libmujs.o $(OUT)/pp.o
$(OUT)/mujs-pp: $(OUT)/pp.o $(OUT)/$(libmujs)
@ mkdir -p $(@D)
$(CC) $(LDFLAGS) -o $@ $^ -lm
$(CC) $(LDFLAGS) -o $@ $< -L$(OUT) -l:$(libmujs) -lm

.PHONY: $(OUT)/mujs.pc
$(OUT)/mujs.pc:
Expand Down

0 comments on commit d592c78

Please sign in to comment.