CC=gcc CFLAGS=-Wall -O2 LDFLAGS=-lssl -lcrypto ARCH=$(shell uname -m) BIN=bin SRC=src ifdef DEBUG CC=/opt/homebrew/opt/llvm/bin/clang CFLAGS+= -fsanitize=address -g endif ifeq ($(ARCH), arm64) # Mac ARM installation CFLAGS+= -I/opt/homebrew/opt/openssl@3.2/include LDFLAGS+= -L/opt/homebrew/opt/openssl@3.2/lib endif SRCS=$(wildcard $(SRC)/*.c) BINS=$(SRCS:$(SRC)/%.c=%) all: $(BINS) %: $(SRC)/%.c $(info Detected $(ARCH) arquitecture.) $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN)/$@ $< clean: rm $(BIN)/*