Fex-II/Makefile

31 lines
753 B
Makefile
Raw Permalink Normal View History

SRCd := src
BINd := bin
OBJd := obj
INCd := inc
CC = gcc
LDFLAGS =
2024-02-22 23:34:30 -06:00
CFLAGS = -Iinc -Wall -O2 -g
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"
$(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