makefile first upload WIP
This commit is contained in:
parent
5563f9bd3e
commit
e6a053cac6
|
@ -53,6 +53,7 @@ dkms.conf
|
|||
|
||||
# project specific for c-basic
|
||||
huffman/testfiles/*
|
||||
huffman/testfiles/
|
||||
bin
|
||||
*/bin
|
||||
obj
|
||||
*/obj
|
||||
|
|
|
@ -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}
|
Loading…
Reference in New Issue