Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # radio-ui: run from this directory.
  2. # make lib panel core library for the application (./radio-ui)
  3. # make test application tests: MPD client, rendering, simulated panel
  4. # make panel-test the panel core's own tests (in $(PANEL_DIR))
  5. # make module the DRM driver, against KDIR (for tests/hw_test.sh drm)
  6. #
  7. # PANEL_DIR is the s1d13700-tca repository, KEYBOARD_DIR radio-keyboard-tca
  8. # (the key overlay the tests compare with): the submodules by default.
  9. BUILD := build
  10. CC ?= gcc
  11. CFLAGS ?= -O2 -g
  12. CFLAGS += -std=gnu11 -Wall -Wextra -MMD -MP
  13. PANEL_DIR ?= panel
  14. KEYBOARD_DIR ?= keyboard
  15. CFLAGS += -I$(PANEL_DIR)/driver -I$(PANEL_DIR)/sim
  16. PYTHON ?= python3
  17. PANEL_LIB := $(BUILD)/libradiopanel.so
  18. CORE := $(PANEL_DIR)/driver/s1d13700_core.c
  19. SIM := $(PANEL_DIR)/sim/s1d13700_sim.c
  20. export PANEL_DIR KEYBOARD_DIR
  21. .PHONY: all lib test pytest panel-test module clean
  22. all: lib
  23. lib: $(PANEL_LIB)
  24. $(CORE) $(SIM):
  25. @echo "$@ missing: run 'git submodule update --init' or set PANEL_DIR" >&2; exit 1
  26. $(PANEL_LIB): radio/libpanel.c $(CORE) $(SIM)
  27. @mkdir -p $(dir $@)
  28. $(CC) $(CFLAGS) -fPIC -shared -o $@ radio/libpanel.c $(CORE) $(SIM)
  29. test pytest: $(PANEL_LIB)
  30. $(PYTHON) -W 'ignore::DeprecationWarning:gi.events' -m unittest discover -s tests -p 'test_*.py' -v
  31. panel-test:
  32. $(MAKE) -C $(PANEL_DIR) test
  33. module:
  34. $(MAKE) -C $(PANEL_DIR) module
  35. clean:
  36. rm -rf $(BUILD)
  37. -include $(wildcard $(BUILD)/*.d)