forked from apiel/zicBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
126 lines (98 loc) · 3.87 KB
/
makefile
File metadata and controls
126 lines (98 loc) · 3.87 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
MAKE := make cc=$(cc)
include ./make_common.mk
ifeq ($(TARGET_PLATFORM),x86)
# SDL2=`sdl2-config --cflags --libs` -DDRAW_SDL2 -DDRAW_DESKTOP
SMFL=-lsfml-graphics -lsfml-window -lsfml-system -DDRAW_SMFL -DDRAW_DESKTOP
endif
# uncomment to enable to load ttf file as font with absolute path to ttf file
# TTF=`$(PKG_CONFIG) --cflags --libs freetype2`
INC=-I.
BUILD_DIR := build/$(TARGET_PLATFORM)
OBJ_DIR := build/obj/$(TARGET_PLATFORM)
# track header file to be sure that build is automatically trigger if any dependency changes
TRACK_HEADER_FILES = -MMD -MP -MF $(OBJ_DIR)/pixel.d
all: zicLibs buildZic watchZic
sync:
bash sync.sh
$(MAKE) pixel
zicLibs:
@echo "\n------------------ plugins ------------------\n"
$(MAKE) -C host
$(MAKE) -C plugins/audio customBuild
$(MAKE) -C plugins/components/Pixel customBuild
@echo "\nbuild plugins done."
buildZic:
@echo "\n------------------ build zic ------------------\n"
@mkdir -p $(BUILD_DIR)
@mkdir -p $(OBJ_DIR)
$(MAKE) $(BUILD_DIR)/zic
$(BUILD_DIR)/zic:
@echo Build using $(CC)
$(CC) -g -fms-extensions -o $(BUILD_DIR)/zic zic.cpp -ldl $(INC) $(RPI) $(TTF) $(RTMIDI) $(SDL2) $(SMFL) $(SPI_DEV_MEM) $(TRACK_HEADER_FILES)
# Safeguard: include only if .d files exist
-include $(wildcard $(OBJ_DIR)/zic.d)
watchZic:
@echo "\n------------------ watch zic ------------------\n"
./watch.sh
runZic:
@echo "\n------------------ run zic $(TARGET_PLATFORM) ------------------\n"
WIFI_IFACE=wlp0s20f3 $(BUILD_DIR)/zic
dev:
npm run dev
push_wiki:BUILD
node doc.js
cd wiki && git add . && git commit -m "wiki" && git push
git add wiki && git commit -m "wiki" && git push
push:
node doc.js
cd wiki && git add . && git commit -m "wiki" || true && git push
git add . && git commit -m "$(m)" && git push
merge:
git checkout main
git merge develop
git push
git checkout develop
releasePixel:
@echo "Creating GitHub release of zicOs for Zic Pixel on rpi zero..."
cd os/zero2w64 && make
- rm os/zero2w64/output/images/zicOsPixel.zip
cd os/zero2w64/output/images/ && zip zicOsPixel.zip sdcard.img
- gh release delete zicOsPixel -y
gh release create zicOsPixel os/zero2w64/output/images/zicOsPixel.zip --title "zicOs Pixel Rpi zero2w" --notes "This release contains the zicOs for zic Pixel (rpi zero2w)."
make releasePixelFirmware
releasePixelFirmware:
mkdir -p build/pixel_arm64
cp config.json build/pixel_arm64/config.json
- rm build/pixel_arm64/zicPixel.zip
cd build/pixel_arm64/ && zip -r zicPixel.zip *
rm -rf build/pixel_arm64/config.json
- gh release delete zicPixel -y
gh release create zicPixel build/pixel_arm64/zicPixel.zip --title "zicPixel firmware" --notes "This contains the zicPixel firmware, compiled for rpi zero2w."
- rm build/pixel_arm64/zicPixel.zip
PI_TARGET ?= root@zic.local
PI_PASSWORD = password
PI_REMOTE_DIR = /opt/zicBox
buildPi:
make zicLibs cc=pixel_arm64
make buildZic cc=pixel_arm64
pi:
make buildPi
- sshpass -p "$(PI_PASSWORD)" ssh "$(PI_TARGET)" "killall zic"
rsync -avz --progress -e "sshpass -p '$(PI_PASSWORD)' ssh" build/pixel_arm64/ "$(PI_TARGET):$(PI_REMOTE_DIR)/."
rsync -avz --progress -e "sshpass -p '$(PI_PASSWORD)' ssh" data/ "$(PI_TARGET):$(PI_REMOTE_DIR)/data"
make sendConfig
sshpass -p "$(PI_PASSWORD)" ssh "$(PI_TARGET)" "chmod +x $(PI_REMOTE_DIR)/zic"
sshpass -p "$(PI_PASSWORD)" ssh "$(PI_TARGET)" "cd $(PI_REMOTE_DIR) && ./zic"
sendConfig:
sshpass -p "$(PI_PASSWORD)" scp -v config.json $(PI_TARGET):$(PI_REMOTE_DIR)/config.json
buildSplash:
$(CC) -g -fms-extensions -o build/pixel_arm64/splash splash.cpp -fpermissive -I.
splash:
make buildSplash cc=pixel_arm64
sshpass -p "$(PI_PASSWORD)" scp -v build/pixel_arm64/splash $(PI_TARGET):$(PI_REMOTE_DIR)/splash
gpio:
$(CC_ZERO2W64) -g -fms-extensions -o build/pixel_arm64/gpio gpio.cpp -fpermissive -I.
sshpass -p "$(PI_PASSWORD)" scp -v build/pixel_arm64/gpio $(PI_TARGET):$(PI_REMOTE_DIR)/gpio
block:
make -C esp/zicBlock
esp/zicBlock/mainSDL