From c876d3bbefe0dc00c27ca0c12d29da5874946962 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 15 Dec 2021 21:04:28 +0100 Subject: rbutil: Merge rbutil with utils folder. rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21 --- utils/e200rpatcher/Makefile | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 utils/e200rpatcher/Makefile (limited to 'utils/e200rpatcher/Makefile') diff --git a/utils/e200rpatcher/Makefile b/utils/e200rpatcher/Makefile new file mode 100644 index 0000000000..dfe5c1e037 --- /dev/null +++ b/utils/e200rpatcher/Makefile @@ -0,0 +1,56 @@ +CFLAGS=-Wall -W + +ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) +OUTPUT=e200rpatcher.exe +CROSS= +CFLAGS+=-mno-cygwin +else +OUTPUT=e200rpatcher +CROSS=i586-mingw32msvc- +endif + +LIBS = -lusb +WINLIBS = -I libusb-win32-device-bin-0.1.12.1/include libusb-win32-device-bin-0.1.12.1/lib/dynamic/libusb_dyn.c + +NATIVECC = gcc +CC = $(CROSS)gcc +WINDRES = $(CROSS)windres + +all: $(OUTPUT) + +e200rpatcher: e200rpatcher.c bootimg.c + gcc $(CFLAGS) $(LIBS) -o e200rpatcher e200rpatcher.c bootimg.c + strip e200rpatcher + +e200rpatcher.exe: e200rpatcher.c bootimg.c e200rpatcher-rc.o + $(CC) $(CFLAGS) $(WINLIBS) -o e200rpatcher.exe e200rpatcher.c bootimg.c e200rpatcher-rc.o + $(CROSS)strip e200rpatcher.exe + +e200rpatcher-rc.o: e200rpatcher.rc e200rpatcher.manifest + $(WINDRES) -i e200rpatcher.rc -o e200rpatcher-rc.o + +e200rpatcher-mac: e200rpatcher-i386 e200rpatcher-ppc + lipo -create e200rpatcher-ppc e200rpatcher-i386 -output e200rpatcher-mac + +e200rpatcher.dmg: e200rpatcher-mac + mkdir -p e200rpatcher-dmg + cp -p e200rpatcher-mac e200rpatcher-dmg + hdiutil create -srcfolder e200rpatcher-dmg e200rpatcher.dmg + +e200rpatcher-i386: e200rpatcher.c bootimg.c usb.h libusb-i386.a + gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o e200rpatcher-i386 e200rpatcher.c bootimg.c -I. libusb-i386.a + strip e200rpatcher-i386 + +e200rpatcher-ppc: e200rpatcher.c bootimg.c usb.h libusb-ppc.a + gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o e200rpatcher-ppc e200rpatcher.c bootimg.c -I. libusb-ppc.a + strip e200rpatcher-ppc + +bin2c: ../tools/bin2c.c + $(NATIVECC) $(CFLAGS) -o bin2c ../tools/bin2c.c + +bootimg.c: bootloader.bin bin2c + ./bin2c bootloader.bin bootimg + +clean: + rm -f e200rpatcher.exe e200rpatcher-mac e200rpatcher-i386 e200rpatcher-ppc e200rpatcher bin2c bootimg.c bootimg.h *~ e200rpatcher.dmg + rm -rf e200rpatcher-dmg -- cgit v1.2.3