2024-02-22 13:54:52 -06:00
|
|
|
SRCd := src
|
|
|
|
BINd := bin
|
|
|
|
OBJd := obj
|
|
|
|
INCd := inc
|
|
|
|
CC = gcc
|
|
|
|
LDFLAGS =
|
2024-02-22 23:34:30 -06:00
|
|
|
CFLAGS = -Iinc -Wall -O2 -g
|
2024-02-22 13:54:52 -06:00
|
|
|
|
|
|
|
SRC = $(wildcard $(SRCd)/*.c)
|
|
|
|
OBJ = $(SRC:$(SRCd)/%.c=$(OBJd)/%.o)
|
|
|
|
TARGETS = $(SRC:$(SRCd)/%.c=$(BINd)/%)
|
|
|
|
|
|
|
|
main: $(OBJ) $(OBJd)/nprint.o # The option of a single program instead of a suite. WARN: Requires modification of source to remove multiple main()
|
|
|
|
$(CC) $(LDFLAGS) -o $(BINd)/fex $^
|
|
|
|
|
2024-02-22 23:34:30 -06:00
|
|
|
multi: $(TARGETS) # Makes a single executable per object instead of congealing them into a single "fex"
|
2024-02-22 13:54:52 -06:00
|
|
|
|
|
|
|
$(BINd)/%: $(OBJd)/%.o $(OBJd)/nprint.o
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
$(OBJd)/%.o: $(SRCd)/%.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJd)/nprint.o: $(INCd)/nprint.c $(INCd)/nprint.h
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJd)/*.o $(BINd)/*
|
|
|
|
|
2024-02-22 23:34:30 -06:00
|
|
|
.PHONY: main clean
|