문제

I'm using OS X Mavericks (10.9). Is there a way to condense my gcc command a bit, so I don't have to type the following verbose version of a command just to compile?

gcc -L /usr/local/Cellar/libusb/1.0.9/lib -I /usr/local/include -o xout usbtest.c -l usb-1.0
도움이 되었습니까?

해결책

Take devnull's advice and write a Makefile, then all you'll have to do is type:

make

Here is a quick hint at the sort of thing you'll need:

INCLUDES=/usr/local/include
LDIRS=/usr/local/Cellar/libusb/1.0.9/lib
LIBS=usb-1.0
CC=gcc

all: xout

xout: usbtest.c
    $(CC) -L $(LDIRS) -I $(INCLUDES) -o xout usbtest.c -l $(LIBS)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top