Only run xattr if present try 3

This commit is contained in:
Joshua Bell 2021-03-07 16:31:54 -08:00
parent a646cf6611
commit fb08e649cc

View File

@ -8,6 +8,8 @@ TARGETS = $(OUTDIR)/path.BIN \
$(OUTDIR)/chtype.CMD $(OUTDIR)/chtime.CMD \
$(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/online.CMD
XATTR := $(shell command -v xattr 2> /dev/null)
.PHONY: clean all package
all: $(OUTDIR) $(TARGETS)
@ -29,7 +31,9 @@ $(OUTDIR)/%.o: %.s $(HEADERS)
$(OUTDIR)/%.BIN $(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
if command -v xattr &> /dev/null; then xattr -wx prodos.AuxType '00 20' $@; fi
ifdef XATTR
xattr -wx prodos.AuxType '00 20' $@
endif
$(OUTDIR)/%.CMD: $(OUTDIR)/%.cmd.o
ld65 $(LDFLAGS) -o $@ $<