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 $@
#
#
+# 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
+
VID?=0x04b4
PID?=0x8613
# to differentiate the dependency. (Is it %.rel: %.c or %.a51)
for a in $(A51_SOURCES); do \
cp $$a $(BUILDDIR)/; \
- cd $(BUILDDIR) && sdas8051 -logs `basename $$a` && cd ..; done
+ cd $(BUILDDIR) && $(SDAS8051) -logs `basename $$a` && cd ..; done
for s in $(SOURCES); do \
THISREL=$$(basename `echo "$$s" | sed -e 's/\.c$$/\.rel/'`); \
$(CC) -c -I $(FX2LIBDIR)/include $$s -o $(BUILDDIR)/$$THISREL ; done