Skip to content

Commit

Permalink
of: unittest: refactor Makefile
Browse files Browse the repository at this point in the history
Some cleanups:
 - use obj-$(CONFIG_OF_OVERLAY) instead of ifdef ... endif
 - compute targets from obj-y

Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
masahir0y authored and robherring committed Jan 9, 2018
1 parent 0fa1c57 commit bd6dc70
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions drivers/of/unittest-data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@
DTC_FLAGS_testcases := -Wno-interrupts_property
obj-y += testcases.dtb.o

targets += testcases.dtb testcases.dtb.S
obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \
overlay_bad_phandle.dtb.o \
overlay_bad_symbol.dtb.o \
overlay_base.dtb.o

ifdef CONFIG_OF_OVERLAY

obj-y += overlay.dtb.o
obj-y += overlay_bad_phandle.dtb.o
obj-y += overlay_bad_symbol.dtb.o
obj-y += overlay_base.dtb.o

targets += overlay.dtb overlay.dtb.S
targets += overlay_bad_phandle.dtb overlay_bad_phandle.dtb.S
targets += overlay_bad_symbol.dtb overlay_bad_symbol.dtb.S
targets += overlay_base.dtb overlay_base.dtb.S
targets += $(foreach suffix, dtb dtb.S, $(patsubst %.dtb.o,%.$(suffix),$(obj-y)))

# enable creation of __symbols__ node
DTC_FLAGS_overlay := -@
DTC_FLAGS_overlay_bad_phandle := -@
DTC_FLAGS_overlay_bad_symbol := -@
DTC_FLAGS_overlay_base := -@

endif

.PRECIOUS: \
$(obj)/%.dtb.S \
$(obj)/%.dtb

0 comments on commit bd6dc70

Please sign in to comment.