Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. OS ?= LINUX
  2. #OS ?= WINDOWS
  3. #OS ?= MACOSX
  4. #OS ?= BSD
  5. ifeq ($(OS), LINUX) # also works on FreeBSD
  6. CC ?= gcc
  7. CFLAGS ?= -O2 -Wall
  8. hid_bootloader_cli: hid_bootloader_cli.c
  9. $(CC) $(CFLAGS) -s -DUSE_LIBUSB -o hid_bootloader_cli hid_bootloader_cli.c -lusb
  10. else ifeq ($(OS), WINDOWS)
  11. CC = i586-mingw32msvc-gcc
  12. CFLAGS ?= -O2 -Wall
  13. LDLIB = -lsetupapi -lhid
  14. hid_bootloader_cli.exe: hid_bootloader_cli.c
  15. $(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c $(LDLIB)
  16. else ifeq ($(OS), MACOSX)
  17. CC ?= gcc
  18. SDK ?= /Developer/SDKs/MacOSX10.5.sdk
  19. CFLAGS ?= -O2 -Wall
  20. hid_bootloader_cli: hid_bootloader_cli.c
  21. $(CC) $(CFLAGS) -DUSE_APPLE_IOKIT -isysroot $(SDK) -o hid_bootloader_cli hid_bootloader_cli.c -Wl,-syslibroot,$(SDK) -framework IOKit -framework CoreFoundation
  22. else ifeq ($(OS), BSD) # works on NetBSD and OpenBSD
  23. CC ?= gcct
  24. CFLAGS ?= -O2 -Wall
  25. hid_bootloader_cli: hid_bootloader_cli.c
  26. $(CC) $(CFLAGS) -s -DUSE_UHID -o hid_bootloader_cli hid_bootloader_cli.c
  27. endif
  28. clean:
  29. rm -f hid_bootloader_cli hid_bootloader_cli.exe