-
Notifications
You must be signed in to change notification settings - Fork 51
/
make-mingw
55 lines (47 loc) · 2.27 KB
/
make-mingw
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
CC = gcc
GITCOUNT = $(shell git rev-list HEAD --count)
CFLAGS = -Wall -g -O -DMINGW32 -Ihidapi/hidapi -DGITCOUNT='"$(GITCOUNT)"'
LDFLAGS = -s
# Windows
LIBS += -Lhidapi/windows/.libs -lhidapi -lsetupapi
PROG_OBJS = pic32prog.o target.o executive.o serial.o \
adapter-pickit2.o adapter-hidboot.o adapter-an1388.o\
adapter-bitbang.o adapter-stk500v2.o adapter-uhb.o \
adapter-an1388-uart.o configure.o \
family-mx1.o family-mx3.o family-mz.o family-mm.o family-mk.o \
hidapi/windows/.libs/libhidapi.a
# JTAG adapters based on FT2232 chip
CFLAGS += -Ilibusb-win32 -DUSE_MPSSE
PROG_OBJS += adapter-mpsse.o
LIBS += -Llibusb-win32 -lusb-1.0
# Compiling Windows binary from Linux
ifeq (/usr/bin/i586-mingw32msvc-gcc,$(wildcard /usr/bin/i586-mingw32msvc-gcc))
CC = i586-mingw32msvc-gcc
endif
ifeq (/usr/bin/i686-w64-mingw32-gcc,$(wildcard /usr/bin/i686-w64-mingw32-gcc))
CC = i686-w64-mingw32-gcc
endif
all: pic32prog.exe
pic32prog.exe: $(PROG_OBJS)
$(CC) $(LDFLAGS) -o $@ $(PROG_OBJS) $(LIBS)
hidapi/windows/.libs/libhidapi.a:
cd hidapi && ./bootstrap && ./configure --host=i586-mingw32msvc && make
###
adapter-an1388.o: adapter-an1388.c adapter.h hidapi/hidapi/hidapi.h pic32.h
adapter-an1388-uart.o: adapter-an1388-uart.c adapter.h pic32.h serial.h
adapter-bitbang.o: adapter-bitbang.c adapter.h pic32.h serial.h bitbang/ICSP_v1E.inc
adapter-hidboot.o: adapter-hidboot.c adapter.h hidapi/hidapi/hidapi.h pic32.h
adapter-mpsse.o: adapter-mpsse.c libusb-win32/libusb-1.0/libusb.h adapter.h pic32.h
adapter-pickit2.o: adapter-pickit2.c adapter.h hidapi/hidapi/hidapi.h pickit2.h pic32.h
adapter-stk500v2.o: adapter-stk500v2.c adapter.h pic32.h serial.h
adapter-uhb.o: adapter-uhb.c adapter.h hidapi/hidapi/hidapi.h pic32.h
configure.o: configure.c target.h adapter.h
executive.o: executive.c pic32.h
family-mx1.o: family-mx1.c pic32.h
family-mx3.o: family-mx3.c pic32.h
family-mz.o: family-mz.c pic32.h
family-mm.o: family-mm.c pic32.h
family-mk.o: family-mk.c pic32.h
pic32prog.o: pic32prog.c target.h adapter.h serial.h localize.h
serial.o: serial.c adapter.h
target.o: target.c target.h adapter.h localize.h pic32.h