templates/c/Makefile

31 lines
372 B
Makefile
Raw Permalink Normal View History

2024-05-06 21:40:01 +00:00
CC ?= gcc
CFLAGS += -pedantic -Wall -Wextra -O2
2024-05-06 21:40:01 +00:00
OUT := hello
BINDIR ?= /usr/bin
2024-05-06 21:40:01 +00:00
SRC += main.c
OBJ := $(SRC:.c=.o)
.PHONY: all
all: $(OUT)
$(OUT): $(OBJ)
$(CC) -o $@ $<
.PHONY: clean
clean:
$(RM) $(OBJ)
.PHONY: fclean
fclean: clean
$(RM) -r $(OUT)
.PHONY: re
.NOTPARALLEL: re
re: fclean all
.PHONY: install
install:
install -D hello ${BINDIR}/hello --mode 0755