Skip to content

Commit 5f52e03

Browse files
committed
Factor link args out in makefile
1 parent bff9f95 commit 5f52e03

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ OPENSSL_DIR = submodules/rust-openssl
99
OPENSSL = $(OPENSSL_DIR)/$(shell $(MAKE) -s -C $(OPENSSL_DIR) print-target)
1010
PHF_DIR = submodules/rust-phf
1111
PHF = $(PHF_DIR)/$(shell $(MAKE) -s -C $(PHF_DIR) print-targets)
12+
LINK_ARGS = -L $(dir $(OPENSSL)) $(foreach file,$(PHF),-L $(dir $(file)))
1213

1314
all: $(POSTGRES)
1415

@@ -31,11 +32,11 @@ $(PHF): $(BUILDDIR)/submodule-trigger | $(BUILDDIR)
3132

3233
$(POSTGRES): $(POSTGRES_LIB) $(OPENSSL) $(PHF) | $(BUILDDIR)
3334
$(RUSTC) $(RUSTFLAGS) --dep-info $(@D)/postgres.d --out-dir $(@D) \
34-
-L $(dir $(OPENSSL)) $(foreach file,$(PHF),-L $(dir $(file))) $<
35+
$(LINK_ARGS) $<
3536

3637
$(POSTGRES_TEST): $(POSTGRES_LIB) $(OPENSSL) $(PHF) | $(BUILDDIR)
3738
$(RUSTC) $(RUSTFLAGS) --dep-info $(@D)/postgres_test.d --out-dir $(@D) \
38-
-L $(dir $(OPENSSL)) $(foreach file,$(PHF),-L $(dir $(file))) --test $<
39+
$(LINK_ARGS) --test $<
3940

4041
check: $(POSTGRES_TEST)
4142
$<
@@ -44,7 +45,6 @@ clean:
4445
rm -rf $(BUILDDIR)
4546

4647
doc: $(OPENSSL) $(PHF)
47-
rustdoc -L $(dir $(OPENSSL)) $(foreach file,$(PHF),-L $(dir $(file))) \
48-
$(POSTGRES_LIB)
48+
rustdoc $(LINK_ARGS) $(POSTGRES_LIB)
4949

5050
.PHONY: all check clean

0 commit comments

Comments
 (0)