forked from mikeryan/ems-flasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.tmpl
92 lines (71 loc) · 2.15 KB
/
Makefile.tmpl
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
MENUVARS = menu.gb menucs.gb menuc.gb menus.gb
PROG = ems-flasher-real
OBJS = ems.o main.o header.o cmd.o updates.o progress.o flash.o insert.o \
update.o
PROGEMSFILE = ems-flasher-file-real
OBJSEMSFILE = ems-file.o main.o header.o cmd.o updates.o progress.o flash.o insert.o \
update.o
all: $(PROG) menuvars
ems.o: ems.h config.h
ems-file.o: ems.h
main.o: ems.h cmd.h header.h
cmd.o: config.h ems.h header.h updates.h flash.h image.h insert.h update.h \
cmd.h progress.h
updates.o: header.h cmd.h update.h flash.h progress.h
flash.o: ems.h flash.h progress.h
insert.o: ems.h image.h insert.h
update.o: update.h
header.o: header.h
progress.o: ems.h progress.h flash.h
ems-flasher: $(PROG)
$(PROG): $(OBJS) menuvars
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBUSB_LDFLAGS) $(PTHREAD_LDFLAGS)
ems.o: ems.c
$(CC) -c $(CFLAGS) $(LIBUSB_CFLAGS) -o $@ ems.c
ems-flasher-file: $(PROGEMSFILE)
$(PROGEMSFILE): $(OBJSEMSFILE) menuvars
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJSEMSFILE)
menuvars: $(MENUVARS)
menu.gb:
@echo "Please install a menu:"
@echo " Type 'make menu-orig' to restore the precompiled menu."
@echo " Type 'make menu' to build the default menu from source."
@exit 1
menucs.gb: menu.gb
./updateheader.sh -c -s < menu.gb > $@
menuc.gb: menu.gb
./updateheader.sh -c < menu.gb > $@
menus.gb: menu.gb
./updateheader.sh -s < menu.gb > $@
menu-orig:
cp menu.gb.orig menu.gb
make menuvars
menu: FORCE
@if ! test -e menu/Makefile; then \
echo "It seems that the menu submodule is missing."; \
echo "Please type 'git submodule init &&" \
" git submodule update'."; \
exit 1; \
fi
cd menu && make
cp menu/menu.gb .
rgbfix -v -t "MENU#" -l 0x33 -k "01" menu.gb
make menuvars
test: FORCE ems-flasher
cd tests && make test
install: $(PROG) menuvars
mkdir -p $(BINDIR)
install ems-flasher-real "$(BINDIR)"/ems-flasher
mkdir -p "$(DATADIR)"
install $(MENUVARS) "$(DATADIR)"
install ems-flasher.1 "$(MANDIR)"/man1/
clean:
rm -f $(PROG) $(OBJS) $(PROGEMSFILE) $(OBJSEMSFILE)
clean-menu:
rm -f $(MENUVARS)
cd menu && make clean
clean-all: clean clean-menu
cd tests && make clean
.SUFFIXES:
.SUFFIXES: .o .c
FORCE: