1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00
corundum/utils/Makefile
Alex Forencich e6c18cfb68 Move fpga_id into library
Signed-off-by: Alex Forencich <alex@alexforencich.com>
2022-04-19 13:36:02 -07:00

62 lines
1.1 KiB
Makefile

PREFIX ?= /usr/local
BINDIR = $(DESTDIR)$(PREFIX)/bin
CC ?= gcc
CFLAGS ?= -O3
CFLAGS += -Wall
CPPFLAGS += -Ilib -Iinclude
LDFLAGS += -Llib/mqnic
LDLIBS += -lmqnic
LIBMQNIC = lib/mqnic/libmqnic.a
BIN = mqnic-config
BIN += mqnic-dump
BIN += mqnic-fw
BIN += mqnic-bmc
BIN += perout
GENDEPFLAGS = -MD -MP -MF .$(@F).d
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) $(GENDEPFLAGS)
all: $(BIN)
FORCE:
$(LIBMQNIC): FORCE
$(MAKE) -C $(dir $@) $(notdir $@)
%.o: %.c
$(CC) $(ALL_CFLAGS) -c -o $@ $<
mqnic-config: mqnic-config.o timespec.o $(LIBMQNIC)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
mqnic-dump: mqnic-dump.o $(LIBMQNIC)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
mqnic-fw: mqnic-fw.o flash.o flash_spi.o flash_bpi.o bitfile.o $(LIBMQNIC)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
mqnic-bmc: mqnic-bmc.o $(LIBMQNIC)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
perout: perout.o timespec.o
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
install:
install -d $(BINDIR)
install -m 0755 $(BIN) $(BINDIR)
clean:
rm -f $(BIN)
rm -f *.o
rm -f .*.d
-include $(wildcard .*.d)
.PHONY: all install clean FORCE