Skip to content

Commit 660eec2

Browse files
release 1.6 - no functional code changes, just distribution and versioning - see CHANGELOG for details
1 parent 4855428 commit 660eec2

12 files changed

+96
-31
lines changed

CHANGELOG

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2014-07-07 Adam Laurie
2+
* Release 1.6
3+
* Move versioning into Makefile
4+
* Move executables into binaries sub-dir
5+
* Add pre-compiled linux-32/64, osx-32/64 and win-32 executables to repo
6+
* Create dist sub-dir for tarball and zipfile (as google code no longer supports downloads)
7+
18
2014-07-02
29
* Issue #12 - improve readability of address checking routine [tonynaggs]
310
* Re-implement setting of bytes per address according to device family,

Makefile

+40-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
CC = gcc
2-
EXECS = mphidflash
3-
OBJS = main.o hex.o
1+
VERSION_MAIN = 1
2+
VERSION_SUB = 6
3+
4+
CC = gcc
5+
OBJS = main.o hex.o
6+
EXECPATH = binaries
7+
DISTPATH = dist
48

59
ifeq ($(shell uname -s),Darwin)
610
# Rules for Mac OS X
@@ -16,28 +20,53 @@ else
1620
SYSTEM = linux
1721
endif
1822

19-
all: $(EXECS)
23+
CFLAGS += -DVERSION_MAIN=$(VERSION_MAIN) -DVERSION_SUB=$(VERSION_SUB)
24+
25+
all:
26+
@echo
27+
@echo Please make 'mphidflash32' or 'mphidflash64' for 32 or 64 bit version
28+
@echo
2029

2130
*.o: mphidflash.h
2231

2332
.c.o:
2433
$(CC) $(CFLAGS) -c $*.c
2534

35+
mphidflash64: CFLAGS += -m64
36+
mphidflash64: LDFLAGS += -m64
37+
mphidflash64: EXEC = mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-$(SYSTEM)-64
38+
mphidflash64: mphidflash
39+
2640
mphidflash32: CFLAGS += -m32
2741
mphidflash32: LDFLAGS += -m32
42+
mphidflash32: EXEC = mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-$(SYSTEM)-32
2843
mphidflash32: mphidflash
2944

3045
mphidflash: $(OBJS)
31-
$(CC) $(OBJS) $(LDFLAGS) -o mphidflash
32-
strip mphidflash
46+
$(CC) $(OBJS) $(LDFLAGS) -o $(EXECPATH)/$(EXEC)
47+
strip $(EXECPATH)/$(EXEC)
48+
49+
install:
50+
@echo
51+
@echo Please make 'install32 or install64' to install 32 or 64 bit target
52+
@echo
3353

3454
# Must install as root; e.g. 'sudo make install'
35-
install: mphidflash
36-
cp mphidflash /usr/local/bin
55+
install32: mphidflash32
56+
cp $(EXECPATH)/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-$(SYSTEM)-32 /usr/local/bin/mphidflash
57+
58+
install64: mphidflash64
59+
cp $(EXECPATH)/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-$(SYSTEM)-64 /usr/local/bin/mphidflash
3760

3861
clean:
39-
rm -f $(EXECS) *.o core
62+
rm -f *.o core
63+
64+
bindist: tarball zipfile
65+
66+
tarball:
67+
tar cvzf $(DISTPATH)/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-bin.tar.gz README.txt CHANGELOG COPYING $(EXECPATH)/*$(VERSION_MAIN).$(VERSION_SUB)*
4068

41-
bindist: $(EXECS)
42-
tar cvzf mphidflash-bin-$(SYSTEM).tar.gz README.txt CHANGELOG COPYING $(EXECS)
69+
zipfile:
70+
rm -f $(DISTPATH)/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-bin.zip
71+
zip $(DISTPATH)/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-bin.zip README.txt CHANGELOG COPYING $(EXECPATH)/*$(VERSION_MAIN).$(VERSION_SUB)*
4372

Makefile.win

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
VERSION_MAIN = 1
2+
VERSION_SUB = 6
3+
14
CC = i586-mingw32msvc-gcc
25
EXECS = mphidflash.exe
36
OBJS = main.o hex.o usb-windows.o
4-
CFLAGS = -DWIN
7+
CFLAGS = -DWIN -DVERSION_MAIN=$(VERSION_MAIN) -DVERSION_SUB=$(VERSION_SUB)
58
LDFLAGS = -lhid -lsetupapi
69

710
all: $(EXECS)
@@ -10,13 +13,25 @@ all: $(EXECS)
1013

1114
.c.o:
1215
$(CC) $(CFLAGS) -c $*.c
13-
16+
17+
# todo: add 64 bit target (low priority as 32 bit works on all platforms)
18+
19+
mphidflash32: CFLAGS += -m32
20+
mphidflash32: LDFLAGS += -m32
21+
mphidflash32: mphidflash.exe
22+
1423
mphidflash.exe: $(OBJS)
15-
$(CC) $(OBJS) $(LDFLAGS) -o mphidflash.exe
24+
$(CC) $(OBJS) $(LDFLAGS) -o binaries/mphidflash-$(VERSION_MAIN).$(VERSION_SUB)-win-32.exe
1625

1726
clean:
1827
rm -f $(EXECS) *.o core
1928

20-
bindist: $(EXECS)
21-
zip mphidflash-bin-win.zip README.txt CHANGELOG COPYING $(EXECS)
29+
bindist:
30+
make bindist
31+
32+
tarball:
33+
make tarball
34+
35+
zipfile:
36+
make zipfile
2237

README.txt

+29-12
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@ from the command line:
1717
sudo apt-get install libhid-dev
1818

1919
Assuming you're reading this as the README.txt alongside the source code,
20-
to compile mphidflash, in the Terminal window type:
20+
to compile mphidflash for a 32 or 64 bit system, in the Terminal window type:
21+
22+
make mphidflash32
23+
24+
or
2125

22-
make
26+
make mphidflash64
2327

2428
Then install with the command:
2529

26-
sudo make install
30+
sudo make install32
31+
32+
or
33+
34+
sudo make install64
2735

28-
This will copy the 'mphidflash' executable to /usr/local/bin so you don't need
29-
to specify a complete path to the program each time.
36+
This will copy the appropriate executable to /usr/local/bin/mphidflash so you
37+
don't need to specify a complete path to the program each time.
3038

3139

3240
Mac OS X
@@ -36,16 +44,24 @@ developer tools) already installed. The IDE portion is not used here, just
3644
the command line interface.
3745

3846
Assuming you're reading this as the README.txt alongside the source code,
39-
to compile mphidflash, in the Terminal window type:
47+
to compile mphidflash for a 32 or 64 bit system, in the Terminal window type:
48+
49+
make mphidflash32
50+
51+
or
4052

41-
make
53+
make mphidflash64
4254

4355
Then install with the command:
4456

45-
sudo make install
57+
sudo make install32
58+
59+
or
60+
61+
sudo make install64
4662

47-
This will copy the 'mphidflash' executable to /usr/local/bin so you don't need
48-
to specify a complete path to the program each time.
63+
This will copy the appropriate executable to /usr/local/bin/mphidflash so you
64+
don't need to specify a complete path to the program each time.
4965

5066

5167
Windows
@@ -62,8 +78,9 @@ to compile mphidflash, in the Terminal window type:
6278

6379
make -f Makefile.win
6480

65-
This will create 'mphidflash.exe' which can called from the Windows commmand
66-
line.
81+
This will create a .exe in the binaries sub-directory, which can be called
82+
from the Windows commmand line - e.g. 'mphidflash-1.6-win-32.exe'. You should
83+
copy this file somewhere on your executable path and rename it to 'mphidflash.exe'.
6784

6885

6986
Usage

binaries/mphidflash-1.6-linux-32

13.6 KB
Binary file not shown.

binaries/mphidflash-1.6-linux-64

14.4 KB
Binary file not shown.

binaries/mphidflash-1.6-osx-32

18.5 KB
Binary file not shown.

binaries/mphidflash-1.6-osx-64

18.6 KB
Binary file not shown.

binaries/mphidflash-1.6-win-32.exe

35.9 KB
Binary file not shown.

dist/mphidflash-1.6-bin.tar.gz

46.6 KB
Binary file not shown.

dist/mphidflash-1.6-bin.zip

52 KB
Binary file not shown.

mphidflash.h

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
#ifndef _MPHIDFLASH_H_
3838
#define _MPHIDFLASH_H_
3939

40-
#define VERSION_MAIN 1
41-
#define VERSION_SUB 5
42-
4340
#ifdef DEBUG
4441
#define DEBUGMSG(str) (void)puts(str); fflush(stdout);
4542
#else

0 commit comments

Comments
 (0)