summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/lib/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/lib/Makefile')
-rw-r--r--utils/hwstub/lib/Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/hwstub/lib/Makefile b/utils/hwstub/lib/Makefile
index 7c455e4586..92dd358ce3 100644
--- a/utils/hwstub/lib/Makefile
+++ b/utils/hwstub/lib/Makefile
@@ -1,16 +1,21 @@
-CC=gcc
AR=ar
-CFLAGS=-W -Wall -O2 `pkg-config --cflags libusb-1.0` -std=c99 -g -fPIC
-LDFLAGS=`pkg-config --libs libusb-1.0` -fPIC
+INCLUDE=../include
+CFLAGS=-W -Wall -O2 `pkg-config --cflags libusb-1.0` -std=c99 -g -fPIC -D_XOPEN_SOURCE=700 -I$(INCLUDE)
+CXXFLAGS=-W -Wall -O2 `pkg-config --cflags libusb-1.0` -std=c++11 -g -fPIC -D_XOPEN_SOURCE=700 -I$(INCLUDE)
+LDFLAGS=`pkg-config --libs libusb-1.0` -fPIC -lpthread
LIB=libhwstub.a
SRC=$(wildcard *.c)
-OBJ=$(SRC:.c=.o)
+SRCXX=$(wildcard *.cpp)
+OBJ=$(SRCXX:.cpp=.oxx) $(SRCXX:.cpp=.o)
all: $(LIB)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
+%.oxx: %.cpp
+ $(CXX) $(CXXFLAGS) -c -o $@ $<
+
$(LIB): $(OBJ)
$(AR) rcs $@ $^