From d32e28bde36161fac9688123c867c2609af65c4f Mon Sep 17 00:00:00 2001 From: x1phosura Date: Wed, 13 Apr 2022 17:27:12 -0700 Subject: [PATCH] Improve makefile, change dir structure --- set1/Makefile | 21 +++++++++++++-------- set1/{ => src}/base64.c | 0 2 files changed, 13 insertions(+), 8 deletions(-) rename set1/{ => src}/base64.c (100%) diff --git a/set1/Makefile b/set1/Makefile index bda06dc..411a122 100644 --- a/set1/Makefile +++ b/set1/Makefile @@ -1,14 +1,19 @@ +CC = gcc +CFLAGS = -Wall -Wpedantic -Wextra -std=c99 +DEBUG = -g +LINK = +SRC_DIR = src +OUT_DIR = bin +TARGETS = base64 -CC = gcc -CFLAGS = -Wall -Wpedantic -Wextra -std=c99 -g -RM = rm -all: base64 +all: $(TARGETS) -base64: base64.c - $(CC) -o $@ $^ +%: $(SRC_DIR)/%.c + $(CC) $(CFLAGS) $(LINK) $< -o $(OUT_DIR)/$@ clean: - $(RM) base64 - $(RM) *.o + $(RM) *.o $(OUT_DIR)/* + +.PHONY: all clean diff --git a/set1/base64.c b/set1/src/base64.c similarity index 100% rename from set1/base64.c rename to set1/src/base64.c