Makefile.gmp 1.4 KB
Newer Older
Gerard Ryan's avatar
Gerard Ryan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#Makefile to build and install gmp in palisade
#//TODO: rerunning make on this file forces rebuilds.
#        we should put checks in to prevent that.

all: gmp_unpack gmp_config gmp_make gmp_check gmp_install

clean: clean_gmp

TAR ?= tar

#note change the following directory to the correct one on your install

PALISADE_DIR := $(PWD)
GMP_VER :=6.1.2

#check if the palisade directory is correct
ifneq ($(wildcard $(PALISADE_DIR)), )
 $(info Makefile.gmp running)
else
 $(info Makefile.gmp needs to be updated for correct PALISADE_DIR directory)
endif

THIRD_PARTY_DIR := $(PALISADE_DIR)/third-party
DISTROS_DIR := $(THIRD_PARTY_DIR)/distros
GMP_DISTRO_DIR := $(DISTROS_DIR)/gmp-$(GMP_VER)

gmp_unpack: 
	@echo 'Unpacking gmp for Palisade into $(GMP_DISTRO_DIR)'
	cd $(DISTROS_DIR);\
	$(TAR) xf ./gmp-$(GMP_VER).tar.lz

gmp_config:
	@echo 'Configuring gmp for Palisade in $(GMP_DISTRO_DIR)'
	cd $(GMP_DISTRO_DIR); \
	./configure --prefix=$(THIRD_PARTY_DIR);
  
gmp_make:
	@echo 'making gmp for Palisade in $(GMP_DISTRO_DIR)'
	cd $(GMP_DISTRO_DIR); \
	$(MAKE)
  
gmp_check:
	@echo 'checking gmp for Palisade in $(GMP_DISTRO_DIR)'
	cd $(GMP_DISTRO_DIR); \
	$(MAKE) check
gmp_install:
	@echo 'installing gmp for Palisade in $(THIRD_PARTY_DIR)'
	cd $(GMP_DISTRO_DIR); \
	$(MAKE) install
clean_gmp:
	@echo 'Cleaning gmp installation'
	cd $(DISTROS_DIR);\
	$(RM) -rf gmp-$(GMP_VER)
	cd $(THIRD_PARTY_DIR); \
	$(RM) -rf include lib share