forked from sergev/pic32prog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
64 lines (49 loc) · 2.02 KB
/
makefile
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
CC = gcc
SVNVERS = $(shell svnversion)
CFLAGS = -Wall -g -O -I/opt/local/include -Ihidapi -DSVNVERSION='"$(SVNVERS)"'
LDFLAGS = -g
# Linux
ifneq (,$(wildcard /lib/i386-linux-gnu))
LIBS += -lusb-1.0
HIDSRC = hidapi/hid-libusb.c
endif
# Mac OS X
ifneq (,$(wildcard /System/Library/Frameworks/CoreFoundation.framework))
LIBS += -framework IOKit -framework CoreFoundation
HIDSRC = hidapi/hid-mac.c
endif
PROG_OBJS = pic32prog.o target.o executive.o hid.o \
adapter-pickit2.o adapter-hidboot.o adapter-an1388.o
# Olimex ARM-USB-Tiny JTAG adapter: not finished yet.
CFLAGS += -DUSE_MPSSE
PROG_OBJS += adapter-mpsse.o
LIBS += -L/opt/local/lib -lusb
all: pic32prog
pic32prog: $(PROG_OBJS)
$(CC) $(LDFLAGS) -o $@ $(PROG_OBJS) $(LIBS)
hid.o: $(HIDSRC)
$(CC) $(CFLAGS) -c -o $@ $<
load: demo1986ve91.srec
pic32prog $<
adapter-mpsse: adapter-mpsse.c
$(CC) $(LDFLAGS) $(CFLAGS) -DSTANDALONE -o $@ adapter-mpsse.c $(LIBS)
pic32prog.po: *.c
xgettext --from-code=utf-8 --keyword=_ pic32prog.c target.c adapter-lpt.c -o $@
pic32prog-ru.mo: pic32prog-ru.po
msgfmt -c -o $@ $<
pic32prog-ru-cp866.mo ru/LC_MESSAGES/pic32prog.mo: pic32prog-ru.po
iconv -f utf-8 -t cp866 $< | sed 's/UTF-8/CP866/' | msgfmt -c -o $@ -
cp pic32prog-ru-cp866.mo ru/LC_MESSAGES/pic32prog.mo
clean:
rm -f *~ *.o core pic32prog adapter-mpsse pic32prog.po
install: pic32prog #pic32prog-ru.mo
install -c -s pic32prog /usr/local/bin/pic32prog
# install -c -m 444 pic32prog-ru.mo /usr/local/share/locale/ru/LC_MESSAGES/pic32prog.mo
###
adapter-an1388.o: adapter-an1388.c adapter.h hidapi/hidapi.h pic32.h
adapter-hidboot.o: adapter-hidboot.c adapter.h hidapi/hidapi.h pic32.h
adapter-mpsse.o: adapter-mpsse.c adapter.h
adapter-pickit2.o: adapter-pickit2.c adapter.h pickit2.h pic32.h
executive.o: executive.c pic32.h
pic32prog.o: pic32prog.c target.h localize.h
target.o: target.c target.h adapter.h localize.h pic32.h