Skip to content

Commit

Permalink
Improve Makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Dec 10, 2024
1 parent 6957b4d commit d897ea2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ ARCHIVE_DIR=$(CURDIR)/archives

ANDROID_PACKAGE_NAME=com.agateau.tinywheels.android

ANDROID_FLAVOR=itchio

CONF_BACKUP_DIR=$(CURDIR)/.conf-backup

# Install variables
Expand Down Expand Up @@ -66,6 +68,7 @@ endif

all: build

# Clean
clean: clean-assets clean-desktop clean-tools

clean-desktop:
Expand All @@ -74,17 +77,29 @@ clean-desktop:
clean-tools:
rm -f $(TOOLS_JAR)

# Build
$(TOOLS_JAR):
${GRADLEW} tools:dist

build:
tools: $(TOOLS_JAR)

desktop-build:
${GRADLEW} desktop:dist

tools: $(TOOLS_JAR)
android-build:
$(GRADLEW) android:build

# Run
run: build
cd android/assets && java -jar $(DESKTOP_JAR)

desktop-run: desktop-run

android-run: android-build
adb uninstall $(ANDROID_PACKAGE_NAME) || true
adb install -f android/build/outputs/apk/$(ANDROID_FLAVOR)/debug/android-$(ANDROID_FLAVOR)-debug.apk
adb shell am start -n $(ANDROID_PACKAGE_NAME)/com.agateau.pixelwheels.android.AndroidLauncher

# Classic Unix `make install` target
install:
mkdir -p $(INSTALL_JAR_DIR)
Expand Down

0 comments on commit d897ea2

Please sign in to comment.