diff --git a/Makefile b/Makefile index f96d37d..bc33f6c 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,11 @@ BINPREFIX = $(DESTDIR)${PREFIX}/bin BUILDDIR := build -BIN := snake-asm -SRC := $(wildcard *.asm) -OBJ := ${SRC:%.asm=${BUILDDIR}/%.o} -DEP := ${OBJ:.o=.d} +BIN := snake-asm +SRC := $(wildcard *.asm) +OBJ := ${SRC:%.asm=${BUILDDIR}/%.o} +DEP := ${OBJ:.o=.d} +BINTAR := ${BIN}.tar.gz ASFLAGS += -felf64 @@ -20,6 +21,11 @@ ${BUILDDIR}/%.o: %.asm @$(AS) -o $@ -M -MF ${@:.o=.d} $< $(AS) -o $@ $(ASFLAGS) $< +${BINTAR}: ${BIN} + tar czf $@ $^ + +dist: ${BINTAR} + install: install -d ${BINPREFIX} install ${BIN} ${BINPREFIX} @@ -28,8 +34,8 @@ uninstall: $(RM) ${BINPREFIX}/${BIN} clean: - $(RM) ${BIN} ${OBJ} ${DEP} + $(RM) ${BIN} ${OBJ} ${DEP} ${BINTAR} -include ${DEP} -.PHONY: install uninstall clean +.PHONY: dist install uninstall clean