X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6942ebae59c3904674dce6b67cd07c43a3bbe00d..7e13988c1113d38bec17bd79b71757d78d977e76:/lunaix-os/tests/units/device-tree/makefile?ds=sidebyside diff --git a/lunaix-os/tests/units/device-tree/makefile b/lunaix-os/tests/units/device-tree/makefile new file mode 100644 index 0000000..4d9d530 --- /dev/null +++ b/lunaix-os/tests/units/device-tree/makefile @@ -0,0 +1,38 @@ +include test_build.mkinc + +tests := $(shell cat tests.txt) + +obj = dut/dt_interrupt.o \ + dut/dt.o \ + dut/dtspec.o \ + dut/changeling.o \ + +dtbs := $(addprefix samples/,$(addsuffix .dtb,$(tests))) + +tests := $(addsuffix .test,$(tests)) +run_tests := $(addprefix run.,$(tests)) + +%.dtb: %.dts + $(call status,DTC,$^) + @dtc -q -I dts -O dtb $^ -o $@ + +.PHONY: all run clean + +load.%.o:: load.c + $(call status,CC,$@) + @$(CC) $(CFLAGS) -DTEST_DTBFILE=\"samples/$*.dtb\" -c $^ -o $@ + +%.test: $(obj-shared) $(obj-stubs) $(obj) test-%.o load.%.o + $(call status,LD,$@) + @$(CC) $^ -o $@ + +run.%.test: %.test + $(call status,RUN,$^) + @./$^ + +all: $(dtbs) $(tests) + +run: $(dtbs) $(tests) $(run_tests) + +clean: + @rm -f *.o $(obj) $(test) $(dtbs) \ No newline at end of file