Permalink
Browse files

Refactor Makefiles slightly

  • Loading branch information...
pje committed Mar 22, 2015
1 parent 1eb5e30 commit 0e0d376c9d6c90caa599bc83103cc423697fe4a5
Showing with 21 additions and 16 deletions.
  1. +2 −2 App/Makefile
  2. +17 −12 Extension/Makefile
  3. +2 −2 Makefile
View
@@ -1,5 +1,3 @@
.PHONY: build clean uninstall install launch
PRODUCT_NAME=WavTap
APP_DIR=$$(pwd)
APP_BUILD_DIR=$(APP_DIR)/build/UninstalledProducts
@@ -26,3 +24,5 @@ launch:
uninstall:
osascript -e 'tell application "$(PRODUCT_NAME)"' -e 'quit' -e 'end tell'
rm -rf /Applications/$(PRODUCT_NAME).app
.PHONY: build clean uninstall install launch
View
@@ -1,26 +1,31 @@
.PHONY: build clean install uninstall
PRODUCT_NAME=WavTap
KEXT_DIR=$$(pwd)
KEXT_BUILD_DIR=$(KEXT_DIR)/Build/UninstalledProducts
BUILD_TYPE=Deployment
INSTALL_DESTINATION=/System/Library/Extensionse
build: $(KEXT_BUILD_DIR)/$(PRODUCT_NAME).kext
build:
$(KEXT_BUILD_DIR)/$(PRODUCT_NAME).kext:
cd $(KEXT_DIR)
xcodebuild -project $(KEXT_DIR)/$(PRODUCT_NAME).xcodeproj -target WavTapDriver -configuration $(BUILD_TYPE) clean build
clean:
rm -rf $(KEXT_DIR)/Build
install: $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
install: build
sudo cp -rv $(KEXT_BUILD_DIR)/$(PRODUCT_NAME).kext /System/Library/Extensions
sudo chmod -R 700 /System/Library/Extensions/$(PRODUCT_NAME).kext
sudo chown -R root:wheel /System/Library/Extensions/$(PRODUCT_NAME).kext
sudo kextload -v /System/Library/Extensions/$(PRODUCT_NAME).kext
sudo kextutil /System/Library/Extensions/$(PRODUCT_NAME).kext
$(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext: build
sudo cp -rv $(KEXT_BUILD_DIR)/$(PRODUCT_NAME).kext $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
sudo chmod -R 700 $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
sudo chown -R root:wheel $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
sudo kextload -v $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
sudo kextutil $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
uninstall:
if [[ "$(shell kextstat | grep $(PRODUCT_NAME) | grep -v grep)" ]]; then sudo kextunload /System/Library/Extensions/$(PRODUCT_NAME).kext; fi
sudo rm -rf /System/Library/Extensions/$(PRODUCT_NAME).kext
sudo rm -rf $(INSTALL_DESTINATION)/$(PRODUCT_NAME).kext
sudo rm -rf /Library/Receipts/$(PRODUCT_NAME)*
sudo rm -rf /var/db/receipts/*$(PRODUCT_NAME).*
clean:
rm -rf $(KEXT_DIR)/Build
.PHONY: build clean install uninstall
View
@@ -1,5 +1,3 @@
.PHONY: build-kext build-app clean-kext clean-app uninstall-kext uninstall-app install-kext install-app launch-app build clean uninstall install
ROOT=$$(pwd)
KEXT_DIR=$(ROOT)/Extension
APP_DIR=$(ROOT)/App
@@ -38,3 +36,5 @@ uninstall-app:
uninstall-kext:
cd $(KEXT_DIR) && make uninstall
.PHONY: build-kext build-app clean-kext clean-app uninstall-kext uninstall-app install-kext install-app launch-app build clean uninstall install

0 comments on commit 0e0d376

Please sign in to comment.