Improve makefile, change dir structure
This commit is contained in:
parent
471d31b504
commit
d32e28bde3
|
@ -1,14 +1,19 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -Wpedantic -Wextra -std=c99 -g
|
CFLAGS = -Wall -Wpedantic -Wextra -std=c99
|
||||||
RM = rm
|
DEBUG = -g
|
||||||
|
LINK =
|
||||||
|
SRC_DIR = src
|
||||||
|
OUT_DIR = bin
|
||||||
|
TARGETS = base64
|
||||||
|
|
||||||
all: base64
|
|
||||||
|
|
||||||
base64: base64.c
|
all: $(TARGETS)
|
||||||
$(CC) -o $@ $^
|
|
||||||
|
%: $(SRC_DIR)/%.c
|
||||||
|
$(CC) $(CFLAGS) $(LINK) $< -o $(OUT_DIR)/$@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) base64
|
$(RM) *.o $(OUT_DIR)/*
|
||||||
$(RM) *.o
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue