Skip to content

Commit

Permalink
build: improve readability of Makefile.am
Browse files Browse the repository at this point in the history
* replaced suffix rules by pattern rules
* such pattern rules are already used in Makefile.am
* so doing, the suffixes `.lo.bc` & `.o.bc` are no more needed in SUFFIXES.

Link: https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
Link: https://www.gnu.org/s/make/manual/html_node/Pattern-Rules.html
Signed-off-by: Ariel Otilibili <[email protected]>
  • Loading branch information
Ariel Otilibili committed Nov 26, 2024
1 parent e268fc4 commit ff6203e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,10 @@ am__v_LLVM_LD_ = $(am__v_LLVM_LD_$(AM_DEFAULT_VERBOSITY))
am__v_LLVM_LD_0 = @echo " LLVM.LD " $@;
am__v_LLVM_LD_1 =

SUFFIXES += .lo.bc .o.bc

.o.o.bc:
$(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $(patsubst %.o,%.c,$<)
.lo.lo.bc:
$(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $(patsubst %.lo,%.c,$<)
%.o.bc: %.o
$(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $*.c
%.lo.bc: %.lo
$(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $*.c

%.cg.json: %.bc tools/frr-llvm-cg
tools/frr-llvm-cg -o $@ $<
Expand Down

0 comments on commit ff6203e

Please sign in to comment.