Skip to content

Commit

Permalink
xpadneo, examples: Build hidraw properly on Ubuntu
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed Dec 23, 2024
1 parent b2d8f0d commit 9cccd96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
.vscode
/misc/examples/**/*.o
/misc/examples/c_directional_rumble_test/direction_rumble_test
/misc/examples/c_hidraw/hidraw
docs/_site/**
Expand Down
23 changes: 20 additions & 3 deletions misc/examples/c_hidraw/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
CFLAGS = $(shell pkg-config ncurses --cflags)
LDFLAGS = $(shell pkg-config ncurses --libs)
PROGRAM = hidraw

all: hidraw
CFLAGS += $(shell pkg-config ncurses --cflags)
LDFLAGS += $(shell pkg-config ncurses --libs)

SRC = hidraw.c

OBJ = $(SRC:.c=.o)

.PHONY: all clean

all: $(PROGRAM)

$(PROGRAM): $(OBJ)
$(CC) $< $(LDFLAGS) -o $@

%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -f $(PROGRAM) $(OBJ)

0 comments on commit 9cccd96

Please sign in to comment.