c-basic/Makefile

24 lines
398 B
Makefile
Raw Normal View History

2022-11-26 18:00:11 +01:00
# see https://opensource.com/article/18/8/what-how-makefile
# Usage:
# make # compile all binary
# make clean # remove ALL binaries and objects
.PHONY = all clean
SRCS := $(wildcard *.c)
BINS := $(SRCS:%.c=%)
all: ${BINS}
%: %.o
@echo "Linking..."
gcc $< -o bin/$@ -lm
%.o: %.c
echo "Creating object..."
gcc -c $< -o obj/
clean:
@echo "Cleaning up..."
rm -rvf *.o ${BINS}