Skip to content

Commit

Permalink
ADD: osx package build
Browse files Browse the repository at this point in the history
  • Loading branch information
anak10thn committed Apr 3, 2018
1 parent f7bfd86 commit 2044a64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
BUILD_DIRS := src

.PHONY: all esp8266 ios install uninstall clean $(BUILD_DIRS)
.PHONY: all build esp8266 ios osx install uninstall clean $(BUILD_DIRS)

all: $(BUILD_DIRS)

build: $(BUILD_DIRS)

esp8266: $(BUILD_DIRS)

ios: $(BUILD_DIRS)

osx: $(BUILD_DIRS)

install: $(BUILD_DIRS)

uninstall: $(BUILD_DIRS)
Expand Down
16 changes: 13 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ SDK_IOS=`xcrun -sdk iphoneos --show-sdk-path`
CFLAGS_IOS = -DIOS
GCC_BASE_IOS = $(GCC_BIN_IOS) -Os $(CFLAGS_IOS) -isysroot $(SDK_IOS) -F$(SDK_IOS)/System/Library/Frameworks -F$(SDK_IOS)/System/Library/PrivateFrameworks

.PHONY : all install uninstall clean ios
.PHONY : all build install uninstall clean esp8266 ios osx

all:
all: build

build:
@echo "Compiling.........................."
@mkdir -p $(BIN_DIR)
@gcc -w -o $(BIN_DIR)/baik -DUSE_SQLITE $(INCLUDES) $(LIBS) tbaik.c baik_ident.c baik_stack.c baik_expression.c baik_compare.c baik_factor.c interpreter.c interpreterSub.c interpreterClass.c sqlite_common.c -lpthread -lm -lsqlite3
Expand All @@ -31,6 +33,14 @@ ios: tbaik.c baik_ident.c baik_stack.c baik_expression.c baik_compare.c baik_fac
@echo "Bypass signature"
@ldid -S $(BIN_DIR)/baik.ios

osx: build
@echo "Build package"
mkdir -p $(BIN_DIR)/usr/local/bin
sudo chown -R root:wheel $(BIN_DIR)
sudo mv $(BIN_DIR)/baik $(BIN_DIR)/usr/local/bin
sudo chmod +x $(BIN_DIR)/usr/local/bin
sudo pkgbuild --root $(BIN_DIR) --identifier org.toroo.baik --version 8.2 $(BIN_DIR)/uBaik-lang.pkg

install:
-install -d -m 755 $(PREFIX)/bin
-cp -R -L $(BIN_DIR)/baik $(PREFIX)/bin/
Expand All @@ -39,4 +49,4 @@ uninstall:
rm -rf $(PREFIX)/bin/baik

clean:
rm -rf $(BIN_DIR)
sudo rm -rf $(BIN_DIR)

1 comment on commit 2044a64

@anak10thn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5

Please sign in to comment.