Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
106 lines (81 loc) · 2.18 KB
/
Copy pathmakefile
File metadata and controls
106 lines (81 loc) · 2.18 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
NAME := propelleride
DIR := $(shell pwd)
DIR_OPENSPIN := $(DIR)/openspin
DIR_IDE := $(DIR)/ide
DIR_SPINLIB := $(DIR)/spin
DIR_LOADER := $(DIR)/loader
DIR_ROOT := $(DIR)/root
DIR_STAGING := $(DIR)/staging
DIR_BIN := $(DIR_STAGING)/usr/bin
DIR_DEB := $(DIR_STAGING)/DEBIAN
VERSION := $(shell echo `grep -r VERSION= $(DIR_IDE)/PropellerIDE.pro \
| cut -d'=' -f3 \
| sed -e 's/[\r]//g'` \
| sed -e 's/ /./g')
ARCH := $(shell arch)
COMPNAME := $(shell uname -n)
OS := $(shell uname -s)
PACKAGE := ${NAME}-${VERSION}-${ARCH}-${OS}
ifeq ($(shell uname -s),msys) # if Windows
JOBS :=
else
ifneq ($(filter arm%,$(ARCH)),) # if ARM
JOBS := -j2
else # not ARM
JOBS := -j6
endif
endif
# if CPU (uname -m) equals...
ifeq ($(shell uname -n),raspberrypi) # if Raspberry Pi
CPU := armhf
else
ifeq ($(shell uname -m),i686) # if i686
CPU := i386
else ifeq ($(shell uname -m),x86_64) # if x64
CPU := amd64
else
CPU := $(shell uname -m)
endif
endif
all: build_all
help:
@echo "Usage: make [TYPE]"
@echo
@echo "Enter package type to build. Options:"
@echo
@echo " deb debian package"
@echo " win windows installer (not yet available)"
@echo " mac mac bundle (not yet available)"
@echo
@echo " no parameter builds only the binaries"
build_all: build_ide build_openspin build_loader
copy_all: clean_staging copy_root copy_bin
clean: clean_staging
make -C $(DIR_LOADER) clean
make -C $(DIR_OPENSPIN) clean
make -C $(DIR_IDE) clean
clean_staging:
rm -rf $(DIR_STAGING)
build_ide:
cd $(DIR_IDE); qmake PropellerIDE.pro; make $(JOBS)
build_openspin:
cd $(DIR_OPENSPIN); make
build_loader:
cd $(DIR_LOADER); make
copy_bin:
mkdir -p $(DIR_BIN)
cp $(DIR_IDE)/$(NAME) $(DIR_BIN)
cp $(DIR_OPENSPIN)/openspin $(DIR_BIN)
cp $(DIR_LOADER)/p1load $(DIR_BIN)
copy_root:
rsync -ru $(DIR_ROOT)/* $(DIR_STAGING)
#copy_libs:
# cp `ldd $(DIR_IDE)/$(NAME) | grep 'libQt\|libz' | awk '{print $$3}'` $(DIR_BIN)
deb: build_all copy_all
sed -e "s/VERSION/$(VERSION)/" \
-e "s/CPU/$(CPU)/" \
-i $(DIR_DEB)/control
dpkg-deb -b $(DIR_STAGING) propelleride-$(VERSION)-$(CPU).deb
checkout:
git submodule init
git submodule update