summaryrefslogtreecommitdiffstats
path: root/oncology/dpfhack_display/Makefile
blob: c6c32e4f1b818e91204ed7b3066877138d0627e9 (plain)
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
DISTVERSION = 0.12devel

CURDIR = $(shell pwd)

# Make sure this path is correct. Needs to point to dpf.h and libdpf.a
DPFLIB = dpflib
PYDPF = python

FILES = Makefile lcd4linux-svn1142-dpf.patch README Changelog

ifndef DESTDIR
DESTDIR = /tmp
endif

default: $(DPFLIB)/libdpf.a
	-[ -e src ] && (cd src; ./buildall.sh)
	$(MAKE) -C $(PYDPF) install

all: default lcd4linux/lcd4linux

$(DPFLIB)/libdpf.a:
	$(MAKE) -C $(DPFLIB) install

lcd4linux/lcd4linux: $(DPFLIB)/libdpf.a
	./build-dpf-lcd4linux.sh $(CURDIR)

dist: installdist
	tar cfz /tmp/dpfhack-$(DISTVERSION).tgz --numeric-owner -C $(DESTDIR) dpf


PYSCRIPTS += detect.py fulldump.py profiles.py hackit.py
PYSCRIPTS += chartbl.py update.py

LIBFILES += Makefile dpflib.c fwload.c rawusb.c
LIBFILES += sglib.h dpf.h 

FILES += fw/README unixdll.mk
FILES += $(PYDPF)/Makefile $(PYDPF)/py_device.c
FILES += include/usbuser.h include/flash.h
FILES += $(LIBFILES:%=$(DPFLIB)/%)
FILES += $(wildcard src/p_*.s) $(wildcard src/jmptbl*.s)

FILES += reverse/common.in reverse/dump.py reverse/Makefile reverse/README

DPFINST = $(DESTDIR)/dpf

installdist:
	install -d $(DPFINST)
	install -d $(DPFINST)/include
	install -d $(DPFINST)/reverse
	install -d $(DPFINST)/src
	install -d $(DPFINST)/fw
	install -d $(DPFINST)/dpflib
	install -d $(DPFINST)/python
	install -d $(DPFINST)/fw/hexfiles
	install -m644 include/flash.h $(DPFINST)/include
	cp -r fw/hexfiles $(DPFINST)/fw
	install -m644 fw/font4x8.bin $(DPFINST)/fw
	install -m755 $(PYSCRIPTS:%=fw/%) $(DPFINST)/fw
	install -m755 build-dpf-lcd4linux.sh $(DPFINST)
	for i in $(FILES); do \
		install -m644 $$i $(DPFINST)/$$i; \
	done
	install -m600 dpf.conf $(DPFINST)
	install -m600 dpfbig.conf $(DPFINST)
	cd $(DPFINST)/fw; ln -sf ../Debug .

clean:
	rm -fr $(DPFINST)
	$(MAKE) -C $(DPFLIB) clean
	$(MAKE) -C $(PYDPF) clean
	-[ -e lcd4linux/Makefile ] && (cd lcd4linux; make distclean)