25 lines
385 B
Makefile
25 lines
385 B
Makefile
|
.POSIX: # Just kidding, use GNU Make
|
||
|
|
||
|
CC := cc
|
||
|
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
|
||
|
LDFLAGS := -lm -lgmp -lreadline
|
||
|
|
||
|
OBJ := dc.o
|
||
|
|
||
|
ifeq ($(debug),1)
|
||
|
CFLAGS += -Og -g
|
||
|
else
|
||
|
CFLAGS += -O3 -funroll-loops -fomit-frame-pointer
|
||
|
endif
|
||
|
|
||
|
%.o: %.c
|
||
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||
|
|
||
|
dc: $(OBJ)
|
||
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
||
|
|
||
|
dc.o: ns.c arith.c slurp.c
|
||
|
|
||
|
clean:
|
||
|
$(RM) $(OBJ) dc
|