mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-20 01:41:44 +03:00
a76a1322eb
Written by Volkmar Frinken (@vfrinken). This is intended as a lightweight (i.e. minimal dependencies) code generator that can be ported to multiple platforms, especially those with memory constraints. It shouldn't be expected to be anywhere near as fast as the Scheme back end, for lots of reasons. The main goal is portability.
51 lines
710 B
Makefile
51 lines
710 B
Makefile
include ../../config.mk
|
|
|
|
TARGET = libidris2_refc
|
|
|
|
LIBTARGET = $(TARGET).a
|
|
|
|
CFLAGS += -O2
|
|
|
|
SRCS = $(wildcard *.c)
|
|
ifeq ($(OS), windows)
|
|
SRCS += windows/win_utils.c windows/win_hack.c
|
|
LDFLAGS += -lws2_32
|
|
ifeq ($(OLD_WIN), 1)
|
|
CFLAGS += -D_OLD_WIN
|
|
endif
|
|
endif
|
|
OBJS = $(SRCS:.c=.o)
|
|
DEPS = $(OBJS:.o=.d)
|
|
|
|
|
|
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}/refc
|
|
install $(LIBTARGET) *.h ${PREFIX}/idris2-${IDRIS2_VERSION}/refc
|