pihelper-c/Makefile

25 lines
322 B
Makefile
Raw Permalink Normal View History

2024-07-15 02:34:07 +00:00
C_FILES = $(wildcard src/*.c)
O_FILES = $(C_FILES:src/%.c=build/%.o)
.PHONY: all clean
.DEFAULT: all
all: pihelper
libpihelper: $(O_FILES)
gcc -o $@ $^
pihelper: libpihelper
gcc -o $@ $^
build:
@mkdir -p build
build/%.o: src/%.c | build
gcc -c $< -o $@
clean:
-rm -f $(O_FILES)
-rm -f pihelper
-rm -rf build