sdl

FORK: Simple Directmedia Layer
git clone https://git.neptards.moe/neptards/sdl.git
Log | Files | Refs

Makefile-manual (1009B)


      1 ###########################################
      2 # Simple Makefile for HIDAPI test program
      3 #
      4 # Alan Ott
      5 # Signal 11 Software
      6 # 2010-06-01
      7 ###########################################
      8 
      9 all: hidtest-hidraw libs
     10 
     11 libs: libhidapi-hidraw.so
     12 
     13 CC       ?= gcc
     14 CFLAGS   ?= -Wall -g -fpic
     15 
     16 CXX      ?= g++
     17 CXXFLAGS ?= -Wall -g -fpic
     18 
     19 LDFLAGS  ?= -Wall -g
     20 
     21 
     22 COBJS     = hid.o
     23 CPPOBJS   = ../hidtest/hidtest.o
     24 OBJS      = $(COBJS) $(CPPOBJS)
     25 LIBS_UDEV = `pkg-config libudev --libs` -lrt
     26 LIBS      = $(LIBS_UDEV)
     27 INCLUDES ?= -I../hidapi `pkg-config libusb-1.0 --cflags`
     28 
     29 
     30 # Console Test Program
     31 hidtest-hidraw: $(COBJS) $(CPPOBJS)
     32 	$(CXX) $(LDFLAGS) $^ $(LIBS_UDEV) -o $@
     33 
     34 # Shared Libs
     35 libhidapi-hidraw.so: $(COBJS)
     36 	$(CC) $(LDFLAGS) $(LIBS_UDEV) -shared -fpic -Wl,-soname,$@.0 $^ -o $@
     37 
     38 # Objects
     39 $(COBJS): %.o: %.c
     40 	$(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
     41 
     42 $(CPPOBJS): %.o: %.cpp
     43 	$(CXX) $(CXXFLAGS) -c $(INCLUDES) $< -o $@
     44 
     45 
     46 clean:
     47 	rm -f $(OBJS) hidtest-hidraw libhidapi-hidraw.so ../hidtest/hidtest.o
     48 
     49 .PHONY: clean libs