Untitled

 avatar
unknown
plain_text
6 months ago
580 B
3
Indexable
# Compiler and flags
CC = gcc
CFLAGS = -fPIC -I/usr/include/libusb-1.0 -Wall -Wextra
LDFLAGS = -shared -L/lib/arm-linux-gnueabihf/libusb-1.0 -lusb-1.0 -lm

# Target library
TARGET = libLDAhid.so

# Source files
SRCS = LDAhid.c
OBJS = $(SRCS:.c=.o)

# Build target: shared library
all: $(TARGET)

# Compile object file with Position Independent Code (PIC) for shared library
%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

# Link object files into a shared library
$(TARGET): $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS)

# Clean up build files
clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean
Editor is loading...
Leave a Comment