-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.static
52 lines (40 loc) · 1.11 KB
/
Makefile.static
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
TARGET=libusb-1.0.a
CFLAGS=-m32 -I. -Ilibusb -Ilibusb/os -Wall -O2 -DPIC -DHAVE_CONFIG_H -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow
OS_OBJ=
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CFLAGS+=-fPIC -fvisibility=hidden -pthread -DOS_DARWIN -DHAVE_STRUCT_TIMESPEC=1 -DTHREADS_POSIX
OS_OBJ = libusb/os/darwin_usb.o
endif
ifeq ($(UNAME), Linux)
CFLAGS+=-fPIC -fvisibility=hidden -pthread -DUSBI_TIMERFD_AVAILABLE -DOS_LINUX -DHAVE_STRUCT_TIMESPEC=1 -DTHREADS_POSIX
OS_OBJ = libusb/os/linux_usbfs.o
endif
WIN32=
ifeq ($(findstring CYG,$(UNAME)), CYG)
WIN32=1
CC=gcc-3
endif
ifeq ($(findstring MINGW,$(UNAME)), MINGW)
WIN32=1
CC=gcc
endif
ifdef WIN32
CFLAGS+=-DWIN32 -DOS_WINDOWS
OS_OBJ = libusb/os/windows_usb.o \
libusb/os/threads_windows.o \
libusb/os/poll_windows.o
endif
objects= \
libusb/core.o \
libusb/descriptor.o \
libusb/io.o \
libusb/sync.o \
$(OS_OBJ) \
all: $(TARGET)
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $<
$(TARGET): $(objects)
$(AR) rcs $@ $^
clean:
rm -f libusb/*.o libusb/os/*.o $(TARGET)