Skip to content

Commit

Permalink
Use the built-in generic C build rules (#46)
Browse files Browse the repository at this point in the history
Use the built-in generic C build rules

These are almost always more correct in terms of being "standard",
properly accepting the flags, etc.
  • Loading branch information
vifon authored and rgerganov committed Oct 9, 2018
1 parent 7c3d509 commit 1028e2e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ CFLAGS = -Wall
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CFLAGS += -DOSX $(shell pkg-config --cflags hidapi)
LDFLAGS = $(shell pkg-config --libs hidapi)
LDLIBS = $(shell pkg-config --libs hidapi)
else
ifeq ($(UNAME), Linux)
CFLAGS += $(shell pkg-config --cflags hidapi-libusb)
LDFLAGS = $(shell pkg-config --libs hidapi-libusb)
LDLIBS = $(shell pkg-config --libs hidapi-libusb)
else
LDFLAGS = -lhidapi
LDLIBS = -lhidapi
endif
endif

all: scythe.c footswitch.c common.h common.c debug.h debug.c
$(CC) footswitch.c common.c debug.c -o footswitch $(CFLAGS) $(LDFLAGS)
$(CC) scythe.c common.c debug.c -o scythe $(CFLAGS) $(LDFLAGS)
all: footswitch scythe

footswitch: footswitch.c common.c debug.c
scythe: scythe.c common.c debug.c

install: all
$(INSTALL) footswitch $(PREFIX)/bin
Expand Down

0 comments on commit 1028e2e

Please sign in to comment.