Makefile adapts to Windows and Linux

This commit is contained in:
Raphael Assenat 2015-10-24 22:32:08 -04:00
parent 467f3ab3a5
commit bc9ed0b329
1 changed files with 9 additions and 2 deletions

View File

@ -1,8 +1,15 @@
CC=gcc
LD=$(CC)
CFLAGS=-Wall -g `pkg-config hidapi-hidraw --cflags`
LDFLAGS=`pkg-config hidapi-hidraw --libs` -g
UNAME := $(shell uname -s)
ifeq ($(UNAME), Linux)
HIDAPI_NAME=hidapi-hidraw
else
HIDAPI_NAME=hidapi
endif
CFLAGS=-Wall -g `pkg-config $(HIDAPI_NAME) --cflags`
LDFLAGS=`pkg-config $(HIDAPI_NAME) --libs` -g
GTK_CFLAGS=`pkg-config --cflags gtk+-3.0 gmodule-2.0`
GTK_LDFLAGS=`pkg-config --libs gtk+-3.0 gmodule-2.0`