]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - fx2lib/lib/Makefile
Support old and new sdcc/sdas8051/asx8051 versions.
[sigrok-firmware-fx2lafw.git] / fx2lib / lib / Makefile
index 1a9318084b95313698a4a34c996ec51a0623467c..c8f19d553decf0d8a633e2e7861c12e2d6355fca 100644 (file)
@@ -20,16 +20,30 @@ INCLUDES = -I../include
 SDCC = sdcc -mmcs51 $(SDCCFLAGS)
 LIBS = fx2.lib
 
+# The sdcc 8051 assembler binary has/had different names.
+ifneq ($(shell which sdas8051),)
+# Newer sdcc, Debian / Ubuntu
+SDAS8051 = sdas8051
+endif
+ifneq ($(shell which sdcc-sdas8051),)
+# Newer sdcc, Fedora
+SDAS8051 = sdcc-sdas8051
+endif
+ifneq ($(shell which asx8051),)
+# Older sdcc
+SDAS8051 = asx8051
+endif
+
 all: $(LIBS)
 
 $(LIBS): $(FX2_OBJS)
        sdcclib fx2.lib $?
 
 usbav.rel: usbav.a51
-       sdas8051 -logs usbav.a51
+       $(SDAS8051) -logs usbav.a51
 
 int4av.rel: int4av.a51
-       sdas8051 -logs int4av.a51
+       $(SDAS8051) -logs int4av.a51
 
 %.rel: %.c
        $(SDCC) $(INCLUDES) -c $< -o $@