Skip to content

Commit

Permalink
Add dist rule to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaIvanovV committed Feb 14, 2022
1 parent 0f7a012 commit a7da6d0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
Expand All @@ -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

0 comments on commit a7da6d0

Please sign in to comment.