Last active
April 28, 2024 16:36
-
-
Save jdarge/2b9f31a0276ddaa78ca1d557b9c27af3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC_DIR := src | |
INC_DIR := include | |
OBJ_DIR := obj | |
BIN_DIR := bin | |
EXE := $(BIN_DIR)/aes | |
SRC := $(wildcard $(SRC_DIR)/*.c) | |
OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) | |
CFLAGS := -Iinclude -MMD -MP | |
CPPFLAGS := -Wall #Wextra | |
LDFLAGS := -Llib | |
LDLIBS := -lm | |
.PHONY: all | |
all: $(EXE) | |
$(EXE): $(OBJ) | $(BIN_DIR) | |
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ | |
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) | |
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ | |
$(BIN_DIR) $(OBJ_DIR): | |
mkdir $@ | |
clean: | |
@$(RM) -rv $(BIN_DIR) $(OBJ_DIR) leak_info.txt null.d aes* | |
rebuild: clean all | |
-include $(OBJ:.o=.d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment