Permalink
Browse files

Makefile: Add libusb-sniff library rules

  • Loading branch information...
1 parent 0df9ca3 commit 2b80f8e6208857c04ba03403b719b1d6d3788b40 @pali pali committed Apr 7, 2013
Showing with 13 additions and 5 deletions.
  1. +13 −5 src/Makefile
View
@@ -7,22 +7,30 @@ CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE
CFLAGS += -W -Wall -O2 -pedantic -std=c99
LIBS += -lusb
+DEPENDS = Makefile ../config.mk
+
OBJS = main.o nolo.o printf-utils.o image.o fiasco.o device.o usb-device.o cold-flash.o operations.o local.o mkii.o disk.o cal.o
BIN = 0xFFFF
MANGEN = mangen
all: $(BIN) $(BIN).1
-$(BIN): $(OBJS) Makefile ../config.mk
+$(BIN): $(OBJS) $(DEPENDS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBS)
-$(MANGEN): $(MANGEN).o Makefile ../config.mk
+$(MANGEN): $(MANGEN).o $(DEPENDS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
-$(BIN).1: $(BIN) $(MANGEN)
+$(BIN).1: $(BIN) $(MANGEN) $(DEPENDS)
./$(MANGEN) > $@
-%.o: %.c Makefile ../config.mk
+libusb-sniff-32.so: libusb-sniff.c $(DEPENDS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -ldl -shared -m32 -o $@ $<
+
+libusb-sniff-64.so: libusb-sniff.c $(DEPENDS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -ldl -shared -m64 -o $@ $<
+
+%.o: %.c $(DEPENDS)
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
install: $(BIN) $(BIN).1
@@ -34,4 +42,4 @@ uninstall:
$(RM) $(DESTDIR)$(PREFIX)/share/man/man1/$(BIN).1
clean:
- -$(RM) $(OBJS) $(BIN) $(MANGEN) $(MANGEN).o $(BIN).1
+ -$(RM) $(OBJS) $(BIN) $(MANGEN) $(MANGEN).o $(BIN).1 libusb-sniff-32.so libusb-sniff-64.so

0 comments on commit 2b80f8e

Please sign in to comment.