diff --git a/.gitignore b/.gitignore index ca919938c..1ffde05a6 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ /libports/include/zlib /libports/include/gmp/gmp-impl.h /libports/include/gmp/x86_32/gmp-mparam.h +/libports/include/mpc/ /libports/include/mpfr/ /libports/src/lib/gmp/mpn/asm-defs.m4 /libports/src/lib/ncurses/codes.c diff --git a/libports/lib/import/import-mpc.mk b/libports/lib/import/import-mpc.mk new file mode 100644 index 000000000..49ae4e3a2 --- /dev/null +++ b/libports/lib/import/import-mpc.mk @@ -0,0 +1,3 @@ +MPC = mpc-0.9 + +REP_INC_DIR += include/mpc diff --git a/libports/lib/mk/mpc.mk b/libports/lib/mk/mpc.mk new file mode 100644 index 000000000..e9f46da9d --- /dev/null +++ b/libports/lib/mk/mpc.mk @@ -0,0 +1,15 @@ +include $(REP_DIR)/lib/import/import-mpc.mk + +MPC_DIR = $(REP_DIR)/contrib/$(MPC) + +ifeq ($(wildcard $(MPC_DIR)),) +REQUIRES += prepare_mpc +endif + +LIBS = libc gmp mpfr + +SRC_C := $(notdir $(wildcard $(MPC_DIR)/src/*.c)) + +vpath %.c $(MPC_DIR)/src + +SHARED_LIB = 1 diff --git a/libports/ports/mpc.mk b/libports/ports/mpc.mk new file mode 100644 index 000000000..a1e51d68e --- /dev/null +++ b/libports/ports/mpc.mk @@ -0,0 +1,32 @@ +include lib/import/import-mpc.mk + +MPC_TGZ = $(MPC).tar.gz +MPC_URL = http://www.multiprecision.org/mpc/download/$(MPC_TGZ) + +# +# Interface to top-level prepare Makefile +# +PORTS += $(MPC) + +MPC_INCLUDES = include/mpc/mpc.h + +prepare-mpc: $(CONTRIB_DIR)/$(MPC) $(MPC_INCLUDES) + +$(CONTRIB_DIR)/$(MPC): clean-mpc + +# +# Port-specific local rules +# +$(DOWNLOAD_DIR)/$(MPC_TGZ): + $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(MPC_URL) && touch $@ + +$(CONTRIB_DIR)/$(MPC): $(DOWNLOAD_DIR)/$(MPC_TGZ) + $(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@ + +include/mpc/mpc.h: + $(VERBOSE)mkdir -p $(dir $@) + $(VERBOSE)ln -sf ../../$(CONTRIB_DIR)/$(MPC)/src/mpc.h $@ + +clean-mpc: + $(VERBOSE)rm -f $(MPC_INCLUDES) + $(VERBOSE)rm -rf $(CONTRIB_DIR)/$(MPC)