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.
dc/Makefile
2023-09-23 17:26:21 +00:00

48 lines
696 B
Makefile

.POSIX: # Just kidding, use GNU Make
CP := cp -f
CC := cc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
LDFLAGS := -lgmp -lreadline
OBJ := dc.o
ifeq ($(DEBUG),1)
CFLAGS += -Og -g
else
CFLAGS += -O3 -funroll-loops -fomit-frame-pointer
endif
ifdef SAN
CFLAGS += -fsanitize=$(SAN)
endif
ifeq ($(FOR_HUMANS),1)
CPPFLAGS += -DFOR_HUMANS
endif
ifeq ($(DC_COMPLY),1)
CPPFLAGS += -DDC_COMPLY
endif
ifdef PROGN
CPPFLAGS += -DPROGN=\"$(PROGN)\"
else
PROGN := dc
endif
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(PROGN): $(OBJ)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
config.h: config.mk.h
$(CP) $< $@
dc.o: config.h ns.c
clean:
$(RM) $(OBJ) $(PROGN)