1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00
corundum/lib/mqnic/Makefile
Alex Forencich a1cd110074 Peel off common software components into a static library
Signed-off-by: Alex Forencich <alex@alexforencich.com>
2022-04-19 01:45:01 -07:00

41 lines
671 B
Makefile

PREFIX ?= /usr/local
INCDIR = $(DESTDIR)$(PREFIX)/include
LIBDIR = $(DESTDIR)$(PREFIX)/lib
DEVLIBDIR = $(LIBDIR)
CC ?= gcc
CFLAGS ?= -O3 -fPIC
CFLAGS += -Wall
CPPFLAGS +=
LIB = libmqnic.a
INCLUDES = mqnic.h mqnic_hw.h mqnic_ioctl.h reg_block.h
GENDEPFLAGS = -MD -MP -MF .$(@F).d
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) $(GENDEPFLAGS)
all: $(LIB)
%.o: %.c
$(CC) $(ALL_CFLAGS) -c -o $@ $<
libmqnic.a: mqnic.o reg_block.o
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