Skip to content

Commit

Permalink
build: force toml.a to use -fPIC with make shared (#77)
Browse files Browse the repository at this point in the history
* build: force toml.a to use -fPIC with make shared
  • Loading branch information
dwelch-spike authored Dec 6, 2023
1 parent 72d4f8e commit 63edc6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,16 @@ all: $(BINS)
# used as a pre-requisite for make shared
# this rule is not meant for manual use by a user
.PHONY: _set_dynamic_options
_set_dynamic_options: $(TOML)
_set_dynamic_options:
$(eval CFLAGS += -DASB_SHARED_LIB)
$(eval DYNAMIC_OPTIONS = -fPIC)

# builds asbackup and asrestore as shared libraries
# asbackup is designed as a standalone exe, use at your own risk
# run this with the same options you would use in a normal build
.PHONY: shared
shared: _set_dynamic_options $(BACKUP_DYNAMIC) $(RESTORE_DYNAMIC)
$(eval DYNAMIC_OPTIONS =)
shared: _set_dynamic_options $(TOML) $(BACKUP_DYNAMIC) $(RESTORE_DYNAMIC)
$(eval DYNAMIC_OPTIONS =)

.PHONY: clean
clean:
Expand Down Expand Up @@ -429,7 +429,7 @@ $(RESTORE_DYNAMIC): $(RESTORE_OBJ) $(TOML) $(C_CLIENT_LIB) $(SECRET_CLIENT_LIB)
$(CXX) $(DYNAMIC_FLAG) $(LDFLAGS) -o $(RESTORE_DYNAMIC) $(RESTORE_OBJ) $(LIBRARIES)

$(TOML):
$(MAKE) -C $(DIR_TOML)
$(MAKE) -C $(DIR_TOML) CFLAGS=$(DYNAMIC_OPTIONS)

$(C_CLIENT_LIB):
$(MAKE) -C $(DIR_C_CLIENT) EVENT_LIB=$(EVENT_LIB)
Expand Down

0 comments on commit 63edc6d

Please sign in to comment.