0

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 3
    Consider writing a Makefile. See [manual](http://www.gnu.org/software/make/manual/). – devnull Dec 06 '13 at 17:09
  • You know, it's not 1980 any more, you can use a graphical IDE, that kind of stuff exists even on OSX. – Damon Dec 14 '13 at 18:47

1 Answers1

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)
Community
  • 1
  • 1
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432