This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
probotic/Makefile

47 lines
843 B
Makefile
Raw Normal View History

.POSIX: # Just kidding, use GNU Make
# OVERRIDE ME #
PREFIX := .
PROGN := probotic
CC := cc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
CPPFLAGS := -I/usr/bin/ircclient/
LDFLAGS := -lircclient
SRC.DIR := src
OBJ.DIR := $(PREFIX)/obj
# INC.DIR := include
2023-08-02 09:47:57 -04:00
OBJ := $(addprefix $(OBJ.DIR)/,fetch.o main.o)
# HDR :=
VPATH := $(INC.DIR) $(SRC.DIR) $(OBJ.DIR)
ifeq ($(DEBUG),1)
CFLAGS += -Og -g3
else
CFLAGS += -O3 -flto=auto -fomit-frame-pointer
endif
ifdef SAN
CFLAGS += -fsanitize=$(SAN)
endif
CPPFLAGS += -DPROGN="\"$(PROGN)\""
$(OBJ.DIR)/%.o: $(SRC.DIR)/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(PREFIX)/$(PROGN): $(VPATH) $(PREFIX) $(HDR) | $(OBJ)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $| $(LDFLAGS)
# include/config.h: include/config.mk.h
# cp -f $< $@
$(VPATH) $(PREFIX):
mkdir -p $@
clean:
$(RM) $(OBJ) $(PROGN)