Improve makefile, change dir structure

This commit is contained in:
Horseshoe Crab 2022-04-13 17:27:12 -07:00
parent 471d31b504
commit d32e28bde3
2 changed files with 13 additions and 8 deletions

View File

@ -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