Skip to contentSkip to conversation

tools/usb: Add Makefile

PATCH RESEND In review Davidlohr Bueso 2 participants 3 messages Jul 13, 2010 – Jul 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 tools/usb: Add Makefile

Hi,

This patch adds a Makefile for building 'testusb'.

I am wondering if it should really still use usbdevfs (deprecated), instead of usbfs?

Thanks,
Davidlohr

---
 tools/usb/Makefile |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 tools/usb/Makefile
tools/usb/Makefile new file +14 -0
new file mode 100644
index 0000000..45b5cab
@@ -0,0 +1,14 @@
+# Makefile for building 'usbtest'
+
+CC = $(CROSS_COMPILE)gcc
+PTHREAD_LIBS = -lpthread
+WARNINGS = -Wall
+WARNINGS := $(WARNINGS) -Wextra
+CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
+
+all:
+	$(CC) $(CFLAGS) -o testusb testusb.c
+
+clean:
+	$(RM) testusb
+
Signature · 1 line
1.7.0.4
#1 lore raw

You should Cc it to [email protected] as well.

Quoted 6 lines · Davidlohr Bueso

Hi,

This patch adds a Makefile for building 'testusb'.

I am wondering if it should really still use usbdevfs (deprecated), instead of usbfs?

Patches welcome... ;) Personally I dunno, I just took David's code and changes it a bit.

Quoted 4 lines

Thanks,
Davidlohr

I'd say the above is not acceptable as a commit message. Please include only the text that is intended to go to the commit message above. All additional comments may go under the “---” marker.

Quoted 11 lines
---
 tools/usb/Makefile |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 tools/usb/Makefile
tools/usb/Makefile new file +0 -0
new file mode 100644
index 0000000..45b5cab

tools/usb/Makefile line 6

Quoted 6 lines
tools/usb/Makefile new file +6 -0
@@ -0,0 +1,14 @@
+# Makefile for building 'usbtest'
+
+CC = $(CROSS_COMPILE)gcc
+PTHREAD_LIBS = -lpthread
+WARNINGS = -Wall
+WARNINGS := $(WARNINGS) -Wextra

Is it necessary? Wouldn't plain

WARNINGS = -Wall -Wextra

suffice? I am aware “=” can be overridden by command line and “:=” cannot but I'd use single line anyway.

tools/usb/Makefile line 10

Quoted 4 lines
tools/usb/Makefile new file +4 -0
+CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
+
+all:
+	$(CC) $(CFLAGS) -o testusb testusb.c

IMO, you should also include a rule for ffs-test, ie:

+all: testusb ffs-test
+
+%: %.c
+ $(CC) $(CFLAGS) -o $@ $^

Not tested.

tools/usb/Makefile line 13

Quoted 3 lines
tools/usb/Makefile new file +3 -0
+
+clean:
+	$(RM) testusb

Instead:

tools/usb/Makefile

Quoted 3 lines
tools/usb/Makefile new file +2 -0
+	$(RM) testusb ffs-test
 
+

Unnecessary empty line at EOF.

Other then that, I see no reason why not to include it.

Signature · 4 lines
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
#2 lore raw
Quoted 5 lines · Michał Nazarewicz

You should Cc it to [email protected] as well.

Quoted 2 lines · Davidlohr Bueso

Hi,

Quoted 8 lines
Quoted 4 lines

This patch adds a Makefile for building 'testusb'.

I am wondering if it should really still use usbdevfs (deprecated), instead of usbfs?

Patches welcome... ;) Personally I dunno, I just took David's code and changes it a bit.

I am modifying this a bit, will send patch when ready.

Quoted 54 lines
Quoted 4 lines

Thanks,
Davidlohr

I'd say the above is not acceptable as a commit message. Please include only the text that is intended to go to the commit message above. All additional comments may go under the “---” marker.

Quoted 11 lines
---
 tools/usb/Makefile |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 tools/usb/Makefile
tools/usb/Makefile new file +0 -0
new file mode 100644
index 0000000..45b5cab

tools/usb/Makefile line 6

Quoted 6 lines
tools/usb/Makefile new file +6 -0
@@ -0,0 +1,14 @@
+# Makefile for building 'usbtest'
+
+CC = $(CROSS_COMPILE)gcc
+PTHREAD_LIBS = -lpthread
+WARNINGS = -Wall
+WARNINGS := $(WARNINGS) -Wextra

Is it necessary? Wouldn't plain

WARNINGS = -Wall -Wextra

suffice? I am aware “=” can be overridden by command line and “:=” cannot but I'd use single line anyway.

tools/usb/Makefile line 10

Quoted 4 lines
tools/usb/Makefile new file +4 -0
+CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
+
+all:
+	$(CC) $(CFLAGS) -o testusb testusb.c

IMO, you should also include a rule for ffs-test, ie:

(quoted diff) +4 -0
+all: testusb ffs-test
+
+%: %.c
+	$(CC) $(CFLAGS) -o $@ $^

Not tested.

tools/usb/Makefile line 13

Quoted 3 lines
tools/usb/Makefile new file +3 -0
+
+clean:
+	$(RM) testusb

Instead:

Quoted 8 lines

tools/usb/Makefile

Quoted 3 lines
tools/usb/Makefile new file +2 -0
+	$(RM) testusb ffs-test
 
+

Unnecessary empty line at EOF.

Other then that, I see no reason why not to include it.

Sorry for the delay, I will redo the patch with the suggestions and resend.

Thanks,
Davidlohr