Skip to content

Commit

Permalink
made a change to avoid duplication of LDFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
aodinokov committed May 28, 2024
1 parent 1ab6e15 commit 12866a3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Reflection implementation is based on [DWARF](https://en.wikipedia.org/wiki/DWAR

* Reflection for all native C types.
* 'Deep' functionality for printing, copying, comparing, and freeing memory of complex data structures.
* Supported on Ubuntu, macOS, Windows (msys2) with gcc or clang
* Supported on **Ubuntu, macOS, Windows (msys2)** with **gcc** or **clang**.

[**Example**](/examples/c_app_simplest/):

Expand Down
1 change: 1 addition & 0 deletions doc/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ TPL-_meta_demodb=bin_target
IN-_meta_demodb= \
main.meta.o \
demodb.meta.o
LDFLAGS-_meta_demodb=-Lsrc -lmetac
POST-_meta_demodb=$(METAC_POST_META)

TPL-demodb.reflect.c:=metac_target
Expand Down
1 change: 1 addition & 0 deletions doc/demo/step_03/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TPL-_meta_demodb=bin_target
IN-_meta_demodb= \
main.meta.o \
demodb.meta.o
LDFLAGS-_meta_demodb=-Lsrc -lmetac
POST-_meta_demodb=$(METAC_POST_META)

TPL-demodb.reflect.c:=metac_target
Expand Down
1 change: 1 addition & 0 deletions doc/demo/step_04/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TPL-_meta_demodb=bin_target
IN-_meta_demodb= \
main.meta.o \
demodb.meta.o
LDFLAGS-_meta_demodb=-Lsrc -lmetac
POST-_meta_demodb=$(METAC_POST_META)

TPL-demodb.reflect.c:=metac_target
Expand Down
1 change: 1 addition & 0 deletions doc/demo/step_05/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TPL-_meta_demodb=bin_target
IN-_meta_demodb= \
main.meta.o \
demodb.meta.o
LDFLAGS-_meta_demodb=-Lsrc -lmetac
POST-_meta_demodb=$(METAC_POST_META)

TPL-demodb.reflect.c:=metac_target
Expand Down
4 changes: 2 additions & 2 deletions mk/bin.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# generates target to build binaries and .so
define bin_target_tpl

# add extra LDFLAGS specific for this target
$$(addprefix $1/,$2): LDFLAGS+=$$(LDFLAGS-$2)
# add extra LDFLAGS specific for this target (don't add duplicates)
$$(addprefix $1/,$2): LDFLAGS=$(filter-out $$(LDFLAGS-$2),$(LDFLAGS)) $$(LDFLAGS-$2)

ifneq ($$(CC-$2),)
$$(addprefix $1/,$2): CC=$$(CC-$2)
Expand Down
2 changes: 1 addition & 1 deletion mk/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ IN-$(2:.checkmk=_checkmk.reflect.c)=$$(dir $(2:.c=))_meta_$$(notdir $(2:.checkmk

TPL-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk)):=bin_target
IN-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$(2:.checkmk=_checkmk.meta.o)
LDFLAGS-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(LDFLAGS-$(2:.checkmk=))
LDFLAGS-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(LDFLAGS-$(2:.checkmk=_checkmk))
DEPS-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(DEPS-$(2:.checkmk=))
POST-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(METAC_POST_META)

Expand Down

0 comments on commit 12866a3

Please sign in to comment.