-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 821 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Makefile
# Directories
ASSETS_DIR := ./assets
BUNDLED_DIR := ./bundled
# Files to generate
ANIMATED_BUNDLE := $(BUNDLED_DIR)/animated.go
FONT_BUNDLE := $(BUNDLED_DIR)/font.go
# Default target
bundle: $(ANIMATED_BUNDLE) $(FONT_BUNDLE) fix-packages
# Bundle animated assets
$(ANIMATED_BUNDLE): $(ASSETS_DIR)/animated
mkdir -p $(BUNDLED_DIR)
fyne bundle -o $@ $<
# Bundle font assets
$(FONT_BUNDLE): $(ASSETS_DIR)/font
mkdir -p $(BUNDLED_DIR)
fyne bundle -o $@ $<
# Fix package declaration and variable names
fix-packages: $(ANIMATED_BUNDLE) $(FONT_BUNDLE)
@for file in $(BUNDLED_DIR)/*.go; do \
sed -i 's/package main/package bundled/' $$file; \
sed -i 's/var resource/var Resource/' $$file; \
done
# Clean generated files
clean:
rm -rf $(BUNDLED_DIR)
# Phony targets
.PHONY: bundle fix-packages clean