]> git.earman.xyz Git - sensor-watch.git/commitdiff
tweak Makefile checks, no need for BOARD or DISPLAY to make install
authorJoey Castillo <joeycastillo@utexas.edu>
Fri, 4 Jul 2025 14:59:33 +0000 (10:59 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Fri, 4 Jul 2025 15:00:01 +0000 (11:00 -0400)
Makefile

index de7be3bb74af3ab71c79c3652005516d2b85293b..39b6d8694f4f083d20ff9e48a0f5272b8a023988 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,24 +27,28 @@ endef
 
 # Only require BOARD and DISPLAY for non-clean targets
 ifeq (,$(filter clean,$(MAKECMDGOALS)))
-ifndef BOARD
-  $(error Build failed: BOARD not defined. Use one of the four options below, depending on your hardware:$n$n    make BOARD=sensorwatch_red DISPLAY=display_type$n    make BOARD=sensorwatch_blue DISPLAY=display_type$n    make BOARD=sensorwatch_pro DISPLAY=display_type$n$n)
-endif
+  ifeq (,$(filter install,$(MAKECMDGOALS)))
+    ifndef BOARD
+      $(error Build failed: BOARD not defined. Use one of the four options below, depending on your hardware:$n$n    make BOARD=sensorwatch_red DISPLAY=display_type$n    make BOARD=sensorwatch_blue DISPLAY=display_type$n    make BOARD=sensorwatch_pro DISPLAY=display_type$n$n)
+    endif
+  endif
 
-ifndef DISPLAY
-  $(error Build failed: DISPLAY not defined. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
-else
-  ifeq ($(DISPLAY), custom)
-    DEFINES += -DFORCE_CUSTOM_LCD_TYPE
-  else ifeq ($(DISPLAY), classic)
-    DEFINES += -DFORCE_CLASSIC_LCD_TYPE
-  else ifeq ($(DISPLAY), autodetect)
-    $(warning WARNING: LCD autodetection is experimental and not reliable! We suggest specifying DISPLAY=classic or DISPLAY=custom for reliable operation.)
-  else
-    $(error Build failed: invalid DISPLAY type. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
+  ifeq (,$(filter install,$(MAKECMDGOALS)))
+    ifndef DISPLAY
+      $(error Build failed: DISPLAY not defined. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
+    else
+      ifeq ($(DISPLAY), custom)
+        DEFINES += -DFORCE_CUSTOM_LCD_TYPE
+      else ifeq ($(DISPLAY), classic)
+        DEFINES += -DFORCE_CLASSIC_LCD_TYPE
+      else ifeq ($(DISPLAY), autodetect)
+        $(warning WARNING: LCD autodetection is experimental and not reliable! We suggest specifying DISPLAY=classic or DISPLAY=custom for reliable operation.)
+      else
+        $(error Build failed: invalid DISPLAY type. Use one of the options below, depending on your hardware:$n$n    make BOARD=board_type DISPLAY=classic$n    make BOARD=board_type DISPLAY=custom$n$n)
+      endif
+    endif
   endif
 endif
-endif
 
 ifdef NOSLEEP
     DEFINES += -DMOVEMENT_LOW_ENERGY_MODE_FORBIDDEN