makefile first upload WIP

This commit is contained in:
Christoph J. Scherr 2022-11-26 18:00:11 +01:00
parent 5563f9bd3e
commit e6a053cac6
2 changed files with 25 additions and 1 deletions

3
.gitignore vendored
View File

@ -53,6 +53,7 @@ dkms.conf
# project specific for c-basic # project specific for c-basic
huffman/testfiles/* huffman/testfiles/*
huffman/testfiles/
bin bin
*/bin */bin
obj
*/obj

23
Makefile Normal file
View File

@ -0,0 +1,23 @@
# 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}