Skip to content

Commit

Permalink
Package linux and osx archives as tar.gz.
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed May 18, 2015
1 parent 6ce9b16 commit d564b01
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ SDK_INCLUDES=
ifeq ($(OS),Windows_NT)
TARGET_OS := WINDOWS
DIST_SUFFIX := windows
ZIP_CMD := 7z a
ARCHIVE_CMD := 7z a
ARCHIVE_EXTENSION := zip
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
Expand All @@ -23,7 +24,8 @@ else
TARGET_OS := OSX
DIST_SUFFIX := osx
endif
ZIP_CMD := zip -r
ARCHIVE_CMD := tar czf
ARCHIVE_EXTENSION := tar.gz
endif

VERSION ?= $(shell git describe --always)
Expand All @@ -44,7 +46,7 @@ CCOPTS := $(INCLUDES) $(SDK_INCLUDES) $(CFLAGS) -D$(TARGET_OS) -DVERSION=\"$(VER

DIST_NAME := esptool-$(VERSION)-$(DIST_SUFFIX)
DIST_DIR := $(DIST_NAME)
DIST_ZIP := $(DIST_NAME).zip
DIST_ARCHIVE := $(DIST_NAME).$(ARCHIVE_EXTENSION)

vpath %.c $(SRC_DIR)

Expand All @@ -59,7 +61,7 @@ all: checkdirs $(TARGET)

dist: checkdirs $(TARGET) $(DIST_DIR)
cp $(TARGET) $(DIST_DIR)/
$(ZIP_CMD) $(DIST_ZIP) $(DIST_DIR)
$(ARCHIVE_CMD) $(DIST_ARCHIVE) $(DIST_DIR)

$(TARGET): $(OBJ) main.c
gcc $(SDK_LIBDIR) $(SDK_LIBS) $(CCOPTS) $^ -o $@
Expand Down

0 comments on commit d564b01

Please sign in to comment.