mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
9b2811f263
Previously, the RefC files were located in IDRIS2_PREFIX. This is decoupled to allow users to change the prefix (for ad-hoc library install locations, for example).
48 lines
640 B
Makefile
48 lines
640 B
Makefile
include ../../config.mk
|
|
|
|
TARGET = libidris2_refc
|
|
|
|
LIBTARGET = $(TARGET).a
|
|
|
|
SRCS := $(wildcard *.c)
|
|
OBJS = $(SRCS:.c=.o)
|
|
DEPS = $(OBJS:.o=.d)
|
|
|
|
CFLAGS += -O2
|
|
|
|
ifeq ($(OLD_WIN), 1)
|
|
CPPFLAGS += -D_OLD_WIN
|
|
endif
|
|
|
|
|
|
all: build
|
|
|
|
.PHONY: build
|
|
|
|
build: $(LIBTARGET)
|
|
|
|
$(LIBTARGET): $(OBJS)
|
|
$(AR) rc $@ $^
|
|
$(RANLIB) $@
|
|
|
|
-include $(DEPS)
|
|
|
|
%.d: %.c
|
|
@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
$(RM) $(OBJS) $(LIBTARGET)
|
|
|
|
cleandep: clean
|
|
$(RM) $(DEPS)
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install: build
|
|
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/refc
|
|
install -m 644 $(LIBTARGET) *.h ${PREFIX}/idris2-${IDRIS2_VERSION}/support/refc
|