Skip to content

Commit

Permalink
Build universal binary for OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Aug 1, 2015
1 parent c52b20c commit d3d7b4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CFLAGS = -std=gnu99 -Os -Wall
CXXFLAGS = -std=c++11 -Os -Wall
CFLAGS += -std=gnu99 -Os -Wall
CXXFLAGS += -std=c++11 -Os -Wall


ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -55,7 +55,8 @@ INCLUDES := $(addprefix -I,$(MODULES))

CFLAGS += $(TARGET_CFLAGS)
CXXFLAGS += $(TARGET_CXXFLAGS)
CPPFLAGS += $(INCLUDES) $(SDK_INCLUDES) -D$(TARGET_OS) -DVERSION=\"$(VERSION)\"
LDFLAGS += $(TARGET_LDFLAGS)
CPPFLAGS += $(INCLUDES) $(SDK_INCLUDES) -D$(TARGET_OS) -DVERSION=\"$(VERSION)\"

DIST_NAME := esptool-$(VERSION)-$(DIST_SUFFIX)
DIST_DIR := $(DIST_NAME)
Expand All @@ -71,7 +72,7 @@ dist: $(TARGET) $(DIST_DIR)
$(ARCHIVE_CMD) $(DIST_ARCHIVE) $(DIST_DIR)

$(TARGET): $(OBJECTS)
gcc $^ -o $@
$(CC) $^ -o $@ $(LDFLAGS)
strip $(TARGET)

$(BUILD_DIR):
Expand All @@ -84,4 +85,3 @@ clean:
@rm -f $(OBJECTS)
@rm -f $(TARGET)
@rm -rf esptool-*

9 changes: 6 additions & 3 deletions local/Makefile.local.OSX
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
TARGET = esptool

INSTALLDIR_BIN = /usr/local/bin
TARGET_FLAGS =
TARGET_CFLAGS = -mmacosx-version-min=10.6
TARGET_CXXFLAGS = -mmacosx-version-min=10.6
CC=clang
CXX=clang++
TARGET_FLAGS =
TARGET_CFLAGS = -mmacosx-version-min=10.6 -arch i386 -arch x86_64
TARGET_CXXFLAGS = -mmacosx-version-min=10.6 -arch i386 -arch x86_64
TARGET_LDFLAGS = -arch i386 -arch x86_64

0 comments on commit d3d7b4b

Please sign in to comment.