Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # S1D13700 behind a TCA9539: panel core, simulator, DRM driver, overlay.
  2. # make test panel core tests (no hardware, no libraries)
  3. # make asan the same under ASan and UBSan
  4. # make dtbo device tree overlay(s) from dts/*.dts
  5. # make module DRM driver, against KDIR (default: /usr/src/linux)
  6. BUILD := build
  7. CC ?= gcc
  8. CFLAGS ?= -O2 -g
  9. CFLAGS += -std=gnu11 -Wall -Wextra -MMD -MP
  10. CFLAGS += -Idriver -Isim
  11. KDIR ?= /usr/src/linux
  12. CORE := driver/s1d13700_core.c
  13. SIM := sim/s1d13700_sim.c
  14. DTBOS := $(patsubst dts/%.dts,$(BUILD)/%.dtbo,$(wildcard dts/*.dts))
  15. .PHONY: all test asan dtbo module clean
  16. all: test
  17. $(BUILD)/test_panel: tests/test_panel.c $(CORE) $(SIM)
  18. @mkdir -p $(dir $@)
  19. $(CC) $(CFLAGS) -o $@ $^
  20. $(BUILD)/test_panel_asan: tests/test_panel.c $(CORE) $(SIM)
  21. @mkdir -p $(dir $@)
  22. $(CC) $(CFLAGS) -fsanitize=address,undefined -fno-sanitize-recover=all -o $@ $^
  23. test: $(BUILD)/test_panel
  24. $<
  25. asan: $(BUILD)/test_panel_asan
  26. $<
  27. dtbo: $(DTBOS)
  28. $(BUILD)/%.dtbo: dts/%.dts
  29. @mkdir -p $(dir $@)
  30. dtc -@ -I dts -O dtb -o $@ $<
  31. module:
  32. $(MAKE) -C $(KDIR) M=$(CURDIR)/driver modules
  33. clean:
  34. rm -rf $(BUILD)
  35. -$(MAKE) -C $(KDIR) M=$(CURDIR)/driver clean
  36. -include $(wildcard $(BUILD)/*.d)