2023-12-14 23:08:16 +00:00
|
|
|
BIN = bin
|
|
|
|
OUT = $(BIN)/out
|
2023-12-15 00:38:55 +00:00
|
|
|
INS = /usr/local/bin/nbtvis
|
2023-12-14 23:08:16 +00:00
|
|
|
|
|
|
|
SRC = $(shell find src -type f -name "*.c")
|
|
|
|
OBJ = $(patsubst %.c,$(BIN)/%.o, $(SRC))
|
|
|
|
|
|
|
|
CCFLAGS = -Isrc -std=c2x -Wall -Wextra -pedantic -O0 -g
|
|
|
|
LDFLAGS =
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
LD = gcc
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
|
|
|
|
build: $(OUT)
|
|
|
|
|
|
|
|
$(OBJ): $(BIN)/%.o : %.c
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
$(CC) -c $(CCFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT): $(OBJ) $(ASM_OBJ)
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
$(LD) -o $(OUT) $(OBJ) $(LDFLAGS)
|
|
|
|
|
2023-12-15 00:38:55 +00:00
|
|
|
run:
|
|
|
|
$(OUT)
|
|
|
|
|
|
|
|
install:
|
|
|
|
cp $(OUT) $(INS)
|
|
|
|
chown root: $(INS)
|
|
|
|
|
2023-12-14 23:08:16 +00:00
|
|
|
clean:
|
|
|
|
rm -fr $(BIN)
|