10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-03 20:54:00 +01:00

Improved Ocaml makefile

This commit is contained in:
Anthony Scemama 2015-03-26 01:33:32 +01:00
parent c7765043fe
commit a500848a8b
3 changed files with 34 additions and 13 deletions

View File

@ -1,7 +1,6 @@
# Check if QPACKAGE_ROOT is defined
.NOPARALLEL:
# Check if QPACKAGE_ROOT is defined
ifndef QPACKAGE_ROOT
$(info -------------------- Error --------------------)
$(info QPACKAGE_ROOT undefined. Source the quantum_package.rc script)
@ -30,8 +29,8 @@ default: $(ALL_TESTS) $(ALL_EXE) .gitignore
echo $$i ; \
done >> .gitignore
executables:
$(MAKE) -C $(QPACKAGE_ROOT)/data executables
executables: $(QPACKAGE_ROOT)/data/executables
$(QPACKAGE_ROOT)/scripts/create_executables_list.sh
external_libs:
opam install cryptokit core

View File

@ -0,0 +1,26 @@
#!/bin/bash
#
# Thu Mar 26 01:27:14 CET 2015
if [[ -z ${QPACKAGE_ROOT} ]]
then
print "The QPACKAGE_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
exit -1
fi
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
cd ${QPACKAGE_ROOT}/data
rm -f executables
EXES=$(find ${QPACKAGE_ROOT}/src -perm /u+x -type f | grep -e "${QPACKAGE_ROOT}/src/[^/]*/[^/]*$" |sort )
for EXE in $EXES
do
printf "%-30s %s\n" $(basename $EXE) $EXE | sed "s|${QPACKAGE_ROOT}|\$QPACKAGE_ROOT|g" >> executables
done

View File

@ -8,24 +8,18 @@ ALL_MODULES=$(shell cat NEEDED_MODULES)
EZFIO_DIR=$(QPACKAGE_ROOT)/EZFIO
EZFIO=$(EZFIO_DIR)/lib/libezfio_irp.a
.PHONY: $(ALL_MODULES)
.PHONY: $(ALL_MODULES) ezfio
default: $(EZFIO)
default: ezfio
$(QPACKAGE_ROOT)/scripts/build_modules.sh $(ALL_MODULES)
veryclean:
$(QPACKAGE_ROOT)/scripts/clean_modules.sh $(ALL_MODULES)
$(ALL_MODULES): $(EZFIO)
$(ALL_MODULES): ezfio
$(QPACKAGE_ROOT)/scripts/build_modules.sh $@
executables: $(ALL_MODULES)
rm -f executables ; \
for EXE in $$(find $(QPACKAGE_ROOT)/src -perm /u+x -type f | grep -e "$(QPACKAGE_ROOT)/src/[^/]*/[^/]*$$" |sort ) ; \
do printf "%-30s %s\n" $$(basename $$EXE) $$EXE | sed "s|$(QPACKAGE_ROOT)|\$$QPACKAGE_ROOT|g" >> executables ;\
done
# Define the EZFIO rules
$(EZFIO): $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_ROOT)/src/*/EZFIO.cfg)
$(QPACKAGE_ROOT)/scripts/prepare_ezfio.sh
@ -34,6 +28,8 @@ $(EZFIO): $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_
$(MAKE) ;\
$(MAKE) Python
ezfio: $(EZFIO)
# Frequent typos
clena: clean
veryclena: veryclean