|
2 | 2 | # BUILD COMMON |
3 | 3 | ######################################################################### |
4 | 4 |
|
| 5 | +VERSION ?= 1.0.0-rc10 |
5 | 6 | PREFIX ?= /usr |
6 | 7 | CXXFLAGS ?= -march=native |
7 | 8 | CXXFLAGS += -std=c++11 -Wall -Wno-reorder -fPIC -pie \ |
8 | | - -DVERSION=$(shell cat VERSION) -Wl,-rpath=$(PREFIX)/share/e9tool/lib/ |
| 9 | + -DVERSION=$(VERSION) -Wl,-rpath=$(PREFIX)/share/e9tool/lib/ |
9 | 10 |
|
10 | 11 | E9PATCH_OBJS=\ |
11 | 12 | src/e9patch/e9CFR.o \ |
@@ -181,3 +182,34 @@ tool.sanitize: $(E9TOOL_OBJS) $(E9TOOL_LIBS) |
181 | 182 | $(CXX) $(CXXFLAGS) $(E9TOOL_OBJS) $(E9TOOL_LIBS) -o e9tool \ |
182 | 183 | $(E9TOOL_LDFLAGS) |
183 | 184 |
|
| 185 | +DEB := e9patch_$(VERSION)_amd64.deb |
| 186 | +deb: $(DEB) |
| 187 | + |
| 188 | +$(DEB): install/debian-binary install/control.tar.gz install/data.tar.gz |
| 189 | + fakeroot ar cr $@ $^ |
| 190 | + |
| 191 | +install/debian-binary: debian-dirs |
| 192 | + echo 2.0 > $@ |
| 193 | + |
| 194 | +install/control.tar.gz: install/control/md5sums install/control/control |
| 195 | + (cd install/control;\ |
| 196 | + tar cz --owner root --group root -f ../control.tar.gz .) |
| 197 | + |
| 198 | +install/control/md5sums: install/data |
| 199 | + find $< -type f | xargs md5sum | sed 's#$</##' > $@ |
| 200 | + |
| 201 | +install/control/control: debian-binary-control.in |
| 202 | + sed 's/\bVERSION\b/$(VERSION)/' $< > $@ |
| 203 | + |
| 204 | +install/data.tar.gz: install/data |
| 205 | + (cd $<; tar cz --owner root --group root -f ../data.tar.gz .) |
| 206 | + |
| 207 | +install/data: DESTDIR := install/data |
| 208 | +install/data: tool release install |
| 209 | + |
| 210 | +debian-dirs: |
| 211 | + mkdir -p install/control |
| 212 | + |
| 213 | +.PHONY: all clean install\ |
| 214 | + release debug sanitize tool tool.debug tool.sanitize\ |
| 215 | + deb debian-dirs |
0 commit comments