2024-04-02 04:59:26 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
# ******************************************************************************
|
|
|
|
|
#
|
|
|
|
|
# @file Makefile
|
|
|
|
|
#
|
|
|
|
|
# @brief Makefile for Jack CXL Fabric Management CLI Tool
|
|
|
|
|
#
|
|
|
|
|
# @copyright Copyright (C) 2024 Jackrabbit Founders LLC. All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
# @date Mar 2024
|
|
|
|
|
# @author Barrett Edwards <code@jrlabs.io>
|
|
|
|
|
#
|
|
|
|
|
# ******************************************************************************
|
|
|
|
|
|
|
|
|
|
CC=gcc
|
2024-04-08 05:45:32 +00:00
|
|
|
CFLAGS?= -g3 -O0 -Wall -Wextra
|
|
|
|
|
MACROS?=-D JACK_VERBOSE
|
|
|
|
|
INCLUDE_DIR?=/usr/local/include
|
|
|
|
|
LIB_DIR?=/usr/local/lib
|
|
|
|
|
LOCAL_INCLUDE_DIR?=./include
|
|
|
|
|
LOCAL_LIB_DIR?=./lib
|
|
|
|
|
INCLUDE_PATH=-I $(LOCAL_INCLUDE_DIR) -I $(INCLUDE_DIR) -I /usr/include/glib-2.0 -I /usr/lib/`uname -m`-linux-gnu/glib-2.0/include/ -I /usr/lib64/glib-2.0/include
|
|
|
|
|
LIB_PATH=-L $(LOCAL_LIB_DIR) -L $(LIB_DIR)
|
2024-04-23 02:14:56 +00:00
|
|
|
LIBS=-l mctp -l fmapi -l emapi -l ptrqueue -l arrayutils -l uuid -l timeutils -l cxlstate -l pciutils -l pci
|
2024-04-02 04:59:26 +00:00
|
|
|
TARGET=jack
|
|
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
|
|
$(TARGET): main.c options.o ctrl_handler.o emapi_handler.o fmapi_handler.o cmd_encoder.o
|
|
|
|
|
$(CC) $^ $(CFLAGS) $(MACROS) $(INCLUDE_PATH) $(LIB_PATH) $(LIBS) -o $@
|
|
|
|
|
|
|
|
|
|
cmd_encoder.o: cmd_encoder.c cmd_encoder.h
|
|
|
|
|
$(CC) -c $< $(CFLAGS) $(MACROS) $(INCLUDE_PATH) -o $@
|
|
|
|
|
|
|
|
|
|
fmapi_handler.o: fmapi_handler.c fmapi_handler.h
|
|
|
|
|
$(CC) -c $< $(CFLAGS) $(MACROS) $(INCLUDE_PATH) -o $@
|
|
|
|
|
|
|
|
|
|
emapi_handler.o: emapi_handler.c emapi_handler.h
|
|
|
|
|
$(CC) -c $< $(CFLAGS) $(MACROS) $(INCLUDE_PATH) -o $@
|
|
|
|
|
|
|
|
|
|
ctrl_handler.o: ctrl_handler.c ctrl_handler.h
|
|
|
|
|
$(CC) -c $< $(CFLAGS) $(MACROS) $(INCLUDE_PATH) -o $@
|
|
|
|
|
|
|
|
|
|
options.o: options.c options.h
|
|
|
|
|
$(CC) -c $< $(CFLAGS) $(MACROS) $(INCLUDE_PATH) -o $@
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf ./*.o ./*.a $(TARGET)
|
|
|
|
|
|
|
|
|
|
doc:
|
|
|
|
|
doxygen
|
|
|
|
|
|
|
|
|
|
install: jack
|
|
|
|
|
sudo cp $(TARGET) /usr/local/bin/
|
|
|
|
|
sudo cp completion.bash /etc/bash_completion.d/$(TARGET)-completion.bash
|
|
|
|
|
|
2024-04-08 05:45:32 +00:00
|
|
|
uninstall:
|
|
|
|
|
sudo rm /usr/local/bin/$(TARGET)
|
|
|
|
|
sudo rm /etc/bash_completion.d/$(TARGET)-completion.bash
|
|
|
|
|
|
2024-04-02 04:59:26 +00:00
|
|
|
# List all non file name targets as PHONY
|
2024-04-08 05:45:32 +00:00
|
|
|
.PHONY: all clean doc install uninstall
|
2024-04-02 04:59:26 +00:00
|
|
|
|
|
|
|
|
# Variables
|
|
|
|
|
# $^ Will expand to be all the sensitivity list
|
|
|
|
|
# $< Will expand to be the frist file in sensitivity list
|
|
|
|
|
# $@ Will expand to be the target name (the left side of the ":" )
|
|
|
|
|
# -c gcc will compile but not try and link
|