Skip to content

Commit

Permalink
Makefiles forcing use of local smithlab_cpp sources
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdavidsmith committed Nov 27, 2023
1 parent 7aa4dba commit 845fd14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
CREAD=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

all:
@make -C src SMITHLAB_CPP=$(SMITHLAB_CPP) CREAD=$(CREAD) OPT=1
@make -C src CREAD=$(CREAD) OPT=1

install:
@make -C src SMITHLAB_CPP=$(SMITHLAB_CPP) CREAD=$(CREAD) OPT=1 install
@make -C src CREAD=$(CREAD) OPT=1 install

clean:
@make -C src SMITHLAB_CPP=$(SMITHLAB_CPP) CREAD=$(CREAD) clean
@make -C src CREAD=$(CREAD) clean
22 changes: 3 additions & 19 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,15 @@
#

all_subdirs=common tools
lib_subdirs=common
app_subdirs=tools

# check if a global copy of smithlab_cpp cannot be found and try to
# use a copy that is in the current directory
ifndef SMITHLAB_CPP
SMITHLAB_CPP=$(abspath $(dir $(MAKEFILE_LIST)))/smithlab_cpp
ifeq ("$(wildcard $(SMITHLAB_CPP))","")
$(error SMITHLAB_CPP not set and smithlab_cpp not found)
endif
all_subdirs += $(SMITHLAB_CPP)
lib_subdirs += $(SMITHLAB_CPP)
endif

all:
@for i in $(app_subdirs); do \
make -C $${i} SMITHLAB_CPP=$(SMITHLAB_CPP) SRC_ROOT=$(CREAD) OPT=1; \
done;
@make -C tools SRC_ROOT=$(CREAD) OPT=1

install:
@for i in $(app_subdirs); do \
make -C $${i} SMITHLAB_CPP=$(SMITHLAB_CPP) SRC_ROOT=$(CREAD) OPT=1 install; \
done;
@make -C tools SRC_ROOT=$(CREAD) OPT=1 install

clean:
@for i in $(all_subdirs); do \
make -C $${i} SMITHLAB_CPP=$(SMITHLAB_CPP) SRC_ROOT=$(CREAD) clean; \
make -C $${i} SRC_ROOT=$(CREAD) clean; \
done;
4 changes: 1 addition & 3 deletions src/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
# along with CREAD; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

ifndef SMITHLAB_CPP
$(error SMITHLAB_CPP variable undefined)
endif
SMITHLAB_CPP = ../smithlab_cpp

PROGS = basecomp bbcomp decoymasker getcontext \
formattable joinmotifs motifclass uniqmotifs \
Expand Down

0 comments on commit 845fd14

Please sign in to comment.