2022-04-19 01:45:01 -07:00
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
INCDIR = $(DESTDIR)$(PREFIX)/include
|
|
|
|
LIBDIR = $(DESTDIR)$(PREFIX)/lib
|
|
|
|
DEVLIBDIR = $(LIBDIR)
|
|
|
|
|
|
|
|
CC ?= gcc
|
|
|
|
CFLAGS ?= -O3 -fPIC
|
|
|
|
|
|
|
|
CFLAGS += -Wall
|
|
|
|
CPPFLAGS +=
|
|
|
|
|
|
|
|
LIB = libmqnic.a
|
2022-07-28 17:52:19 -07:00
|
|
|
INCLUDES = mqnic.h mqnic_hw.h mqnic_ioctl.h reg_if.h reg_block.h fpga_id.h
|
2022-04-19 01:45:01 -07:00
|
|
|
|
|
|
|
GENDEPFLAGS = -MD -MP -MF .$(@F).d
|
|
|
|
|
|
|
|
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) $(GENDEPFLAGS)
|
|
|
|
|
|
|
|
all: $(LIB)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(ALL_CFLAGS) -c -o $@ $<
|
|
|
|
|
2022-11-23 17:38:18 -08:00
|
|
|
libmqnic.a: mqnic.o mqnic_if.o mqnic_port.o mqnic_sched_block.o mqnic_scheduler.o mqnic_clk_info.o mqnic_stats.o reg_if.o reg_block.o fpga_id.o
|
2022-04-19 01:45:01 -07:00
|
|
|
ar rcs $@ $^
|
|
|
|
|
|
|
|
install:
|
|
|
|
install -d $(DEVLIBDIR) $(INCDIR)/mqnic
|
|
|
|
install -m 0644 $(LIB) $(DEVLIBDIR)
|
|
|
|
install -m 0644 $(INCLUDES) $(INCDIR)/mqnic
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(LIB)
|
|
|
|
rm -f *.o
|
|
|
|
rm -f .*.d
|
|
|
|
|
|
|
|
-include $(wildcard .*.d)
|
|
|
|
|
|
|
|
.PHONY: all install clean
|