Rewrite Makefile, move WITH_DEVICE, WITH_USB and WITH_SQUEUES to Makefile
This commit is contained in:
1 parent
67d3e4de70
commit
83bcb7358c
11 files changed
+44
-44
No files matched your search
@@ -1,9 +1,10 @@
|
||||
VERSION=0.5
|
||||
PREFIX=/usr/local
|
||||
VERSION = 0.6
|
||||
PREFIX = /usr/local
|
||||
|
||||
WITH_USB = 1
|
||||
#WITH_DEVICE = 1
|
||||
WITH_SQUEUES = 1
|
||||
|
||||
# NetBSD stuff
|
||||
CFLAGS+=-I/usr/pkg/include -g -O2
|
||||
LDFLAGS+=-L/usr/pkg/lib -Wl,-R/usr/pkg/lib
|
||||
|
||||
HAVE_USB=1
|
||||
HAVE_GUI=1
|
||||
#CFLAGS += -I/usr/pkg/include -g -O2
|
||||
#LDFLAGS += -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
|
||||
+21
-22
@@ -1,31 +1,30 @@
|
||||
include ../config.mk
|
||||
OBJ=main.o dump.o nolo.o qmode.o
|
||||
OBJ+=printf-utils.o console.o
|
||||
OBJ+=squeue/squeue.o
|
||||
OBJ+=image.o fiasco.o device.o usb-device.o cold-flash.o
|
||||
BIN=0xFFFF
|
||||
#LIBS=`${HAVE_USB} && echo -- '-lusb'`
|
||||
LIBS=`if [ "${HAVE_USB}" = 1 ]; then echo '-lusb'; fi`
|
||||
CFLAGS+=-DVERSION=\"${VERSION}\" -Wall -I .
|
||||
CFLAGS+=-pedantic -std=c99 -DHAVE_USB=${HAVE_USB} -Wno-unused-result
|
||||
USBOBJ=../libusb/error.o ../libusb/usb.o ../libusb/descriptors.o
|
||||
USBOBJ+=../libusb/linux.o ## XXX not portable
|
||||
|
||||
CFLAGS+=-I../libusb
|
||||
LDFLAGS+=-L../libusb
|
||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE
|
||||
CFLAGS += -DVERSION=\"$(VERSION)\" -W -Wall -Wno-unused-parameter -Wno-unused-result -O2 -pedantic -std=c99 -I.
|
||||
ifdef WITH_USB
|
||||
CPPFLAGS += -DWITH_USB
|
||||
LIBS += -lusb
|
||||
endif
|
||||
|
||||
CFLAGS+=-D_GNU_SOURCE
|
||||
ifdef WITH_DEVICE
|
||||
CPPFLAGS += -DWITH_DEVICE
|
||||
endif
|
||||
|
||||
all: ${BIN}
|
||||
ifdef WITH_SQUEUES
|
||||
CPPFLAGS += -DWITH_SQUEUES
|
||||
endif
|
||||
|
||||
${BIN}: ${OBJ}
|
||||
${CC} ${LDFLAGS} -o ${BIN} ${OBJ} ${LIBS}
|
||||
OBJS = main.o nolo.o printf-utils.o image.o fiasco.o device.o usb-device.o cold-flash.o dump.o qmode.o console.o squeue/squeue.o
|
||||
BIN = 0xFFFF
|
||||
|
||||
allusb: ${OBJ}
|
||||
${CC} ${LDFLAGS} -o ${BIN} ${OBJ} ${USBOBJ}
|
||||
all: $(BIN)
|
||||
|
||||
static: ${OBJ}
|
||||
${CC} ${LDFLAGS} -o ${BIN} -static ${OBJ} ${USBOBJ}
|
||||
$(BIN): $(OBJS) Makefile ../config.mk
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBS)
|
||||
|
||||
%.o: %.c Makefile ../config.mk
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
-rm -f ${OBJ} ${BIN}
|
||||
-rm -f $(OBJS) $(BIN)
|
||||
+2
-1
@@ -23,11 +23,12 @@
|
||||
#include <errno.h>
|
||||
#include <usb.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "cold-flash.h"
|
||||
#include "image.h"
|
||||
#include "usb-device.h"
|
||||
#include "printf-utils.h"
|
||||
#include "global.h"
|
||||
|
||||
#define READ_DEV 0x81
|
||||
#define WRITE_DEV 0x01
|
||||
|
||||
+3
-1
@@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_USB
|
||||
#if WITH_USB
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <global.h>
|
||||
|
||||
#include "console.h"
|
||||
#include "nolo.h"
|
||||
#include "dump.h"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "device.h"
|
||||
|
||||
static const char * devices[] = {
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "dump.h"
|
||||
#include "printf-utils.h"
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "device.h"
|
||||
#include "image.h"
|
||||
#include "fiasco.h"
|
||||
|
||||
+1
-6
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "image.h"
|
||||
#include "fiasco.h"
|
||||
#include "device.h"
|
||||
@@ -38,16 +39,10 @@
|
||||
#include "qmode.h"
|
||||
#include "nolo.h"
|
||||
|
||||
#undef VERSION
|
||||
#define VERSION "0.6"
|
||||
|
||||
static void show_title(void) {
|
||||
printf("0xFFFF v%s // The Free Fiasco Firmware Flasher\n", VERSION);
|
||||
}
|
||||
|
||||
#define WITH_USB
|
||||
//#define WITH_DEVICE
|
||||
|
||||
static void show_usage(void) {
|
||||
|
||||
int i;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "printf-utils.h"
|
||||
|
||||
int printf_prev = 0;
|
||||
|
||||
+2
-6
@@ -27,15 +27,11 @@
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "qmode.h"
|
||||
#include "nolo.h"
|
||||
|
||||
#if __linux__ || __NetBSD__ || __FreBSD__ || __OpenBSD__ || __Darwin__ || __MacOSX__
|
||||
#define HAVE_SQUEUE 1
|
||||
#else
|
||||
#define HAVE_SQUEUE 0
|
||||
#endif
|
||||
|
||||
#if HAVE_SQUEUE
|
||||
|
||||
#include "squeue/squeue.h"
|
||||
|
||||
@@ -37,7 +37,6 @@ static struct usb_flash_device usb_devices[] = {
|
||||
{ 0x0421, 0x01c8, 1, 1, -1, FLASH_MKII, { DEVICE_RX_51, 0 } },
|
||||
{ 0x0421, 0x0431, 0, -1, -1, FLASH_DISK, { DEVICE_SU_18, DEVICE_RX_34, 0 } },
|
||||
{ 0x0421, 0x3f00, 2, 1, -1, FLASH_NOLO, { DEVICE_RX_34, 0 } },
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
static const char * usb_flash_protocols[] = {
|
||||
|
||||
Reference in new issue
Block a user