bit-release/Makefile

35 lines
775 B
Makefile
Raw Normal View History

2024-04-02 04:29:15 +00:00
# SPDX-License-Identifier: Apache-2.0
2024-03-28 23:32:13 +00:00
CC=gcc
CFLAGS= -g3 -O0 -Wall -Wextra
INCLUDE_DIR=/usr/local/include/
LIB_DIR=/usr/local/lib
INCLUDE_PATH=-I $(INCLUDE_DIR)
LIB_PATH=-L $(LIB_DIR)
LIBS=
all: testbench
testbench: testbench.c bit.o
$(CC) $^ $(CFLAGS) $(INCLUDE_PATH) $(LIB_PATH) $(LIBS) -o $@
libbit.a: bit.o
ar rcs $@ $^
bit.o: bit.c bit.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATH) -o $@
clean:
rm -rf ./*.o ./*.a testbench
install: libbit.a
sudo cp libbit.a $(LIB_DIR)
sudo cp bit.h $(INCLUDE_DIR)
.PHONY: all clean install
# 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