Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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: the submodule by default.
  8. BUILD := build
  9. CC ?= gcc
  10. CFLAGS ?= -O2 -g
  11. CFLAGS += -std=gnu11 -Wall -Wextra -MMD -MP
  12. PANEL_DIR ?= panel
  13. CFLAGS += -I$(PANEL_DIR)/driver -I$(PANEL_DIR)/sim
  14. PYTHON ?= python3
  15. PANEL_LIB := $(BUILD)/libradiopanel.so
  16. CORE := $(PANEL_DIR)/driver/s1d13700_core.c
  17. SIM := $(PANEL_DIR)/sim/s1d13700_sim.c
  18. export PANEL_DIR
  19. .PHONY: all lib test pytest panel-test module clean
  20. all: lib
  21. lib: $(PANEL_LIB)
  22. $(CORE) $(SIM):
  23. @echo "$@ missing: run 'git submodule update --init' or set PANEL_DIR" >&2; exit 1
  24. $(PANEL_LIB): radio/libpanel.c $(CORE) $(SIM)
  25. @mkdir -p $(dir $@)
  26. $(CC) $(CFLAGS) -fPIC -shared -o $@ radio/libpanel.c $(CORE) $(SIM)
  27. test pytest: $(PANEL_LIB)
  28. $(PYTHON) -W 'ignore::DeprecationWarning:gi.events' -m unittest discover -s tests -p 'test_*.py' -v
  29. panel-test:
  30. $(MAKE) -C $(PANEL_DIR) test
  31. module:
  32. $(MAKE) -C $(PANEL_DIR) module
  33. clean:
  34. rm -rf $(BUILD)
  35. -include $(wildcard $(BUILD)/*.d)