diff options
| author | Teddy Wing | 2021-03-07 18:24:12 +0100 |
|---|---|---|
| committer | Teddy Wing | 2021-03-07 18:24:12 +0100 |
| commit | 8f09695671d5678262a9a778ca64db21ac9620ed (patch) | |
| tree | 884483a3dfec4915a4aa62c4b160d54676cf2805 | |
| parent | f326ee4851490204c0aba2692659db2ecf63510d (diff) | |
| download | Re-Good-Catalina-Invert-Colours-8f09695671d5678262a9a778ca64db21ac9620ed.tar.bz2 | |
Makefile: Add rules to build a distribution tarballv0.0.1
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 35 |
2 files changed, 35 insertions, 1 deletions
@@ -1 +1,2 @@ /build/ +/dist/ @@ -24,6 +24,12 @@ BUILD_DIR := $(abspath build) LOCAL_INCLUDE_DIR := $(BUILD_DIR)/include RELEASE_PRODUCT := invert-catalina-invert +LAUNCHD_PLIST := Library/LaunchAgents/com.teddywing.invert-catalina-invert.plist +VERSION := $(shell awk -F '"' '/static const char \*VERSION/ { print $$2 }' main.m) + +DIST := $(abspath dist) +DIST_PRODUCT := $(DIST)/bin/$(RELEASE_PRODUCT) +DIST_LAUNCHD_PLIST := $(DIST)/$(LAUNCHD_PLIST) .PHONY: all @@ -72,4 +78,31 @@ $(LOCAL_INCLUDE_DIR): | $(BUILD_DIR) clean: rm -rf $(RELEASE_PRODUCT) \ $(BUILD_DIR) \ - $(DDHOTKEY_OBJ) + $(DDHOTKEY_OBJ) \ + $(DIST) + + +.PHONY: dist +dist: $(DIST_PRODUCT) $(DIST_LAUNCHD_PLIST) + +$(DIST): + mkdir -p $@ + +$(DIST)/bin: | $(DIST) + mkdir -p $@ + +$(DIST)/Library/LaunchAgents: | $(DIST) + mkdir -p $@ + +$(DIST_PRODUCT): $(DIST)/bin $(RELEASE_PRODUCT) + cp $(RELEASE_PRODUCT) $< + +$(DIST_LAUNCHD_PLIST): $(DIST)/Library/LaunchAgents $(LAUNCHD_PLIST) + cp $(LAUNCHD_PLIST) $< + + +.PHONY: pkg +pkg: invert-catalina-invert_$(VERSION)_x86_64.tar.bz2 + +invert-catalina-invert_$(VERSION)_x86_64.tar.bz2: dist + tar cjv -s /dist/invert-catalina-invert_$(VERSION)_x86_64/ -f $@ dist |
