| 1 |
#************************************************************************* |
| 2 |
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne |
| 3 |
# National Laboratory. |
| 4 |
# Copyright (c) 2002 The Regents of the University of California, as |
| 5 |
# Operator of Los Alamos National Laboratory. |
| 6 |
# EPICS BASE is distributed subject to a Software License Agreement found |
| 7 |
# in the file LICENSE that is included with this distribution. |
| 8 |
#************************************************************************* |
| 9 |
|
| 10 |
# Octave definitions and rules |
| 11 |
|
| 12 |
ifeq ($(findstring Host,$(VALID_BUILDS)),Host) |
| 13 |
|
| 14 |
FILE_TYPE += OCTAVE |
| 15 |
INSTALL_OCTAVE = $(INSTALL_LOCATION_LIB)/octave |
| 16 |
DIRECTORY_TARGETS += $(INSTALL_OCTAVE) |
| 17 |
|
| 18 |
ifdef T_A |
| 19 |
|
| 20 |
MKOCTFILE_FLAGS += --mex --verbose -DOCTAVE |
| 21 |
MKOCTFILE_FLAGS += $(RELEASE_INCLUDES) $(addprefix -L,$(SHRLIB_SEARCH_DIRS)) |
| 22 |
|
| 23 |
vpath %.mex $(USR_VPATH) $(ALL_SRC_DIRS) |
| 24 |
vpath %.m $(USR_VPATH) $(ALL_SRC_DIRS) |
| 25 |
|
| 26 |
define OCTAVES_template |
| 27 |
$(1) : $$($(1)_SRCS) |
| 28 |
endef |
| 29 |
$(foreach file, $(OCTAVES),$(eval $(call OCTAVES_template,$(strip $(file))))) |
| 30 |
|
| 31 |
clean: octave_clean |
| 32 |
|
| 33 |
#This clean works from O.* dirs. |
| 34 |
octave_clean: |
| 35 |
@$(RM) *.mex *.m |
| 36 |
|
| 37 |
.PHONY: octave_clean |
| 38 |
|
| 39 |
.PRECIOUS: *.m *.mex |
| 40 |
|
| 41 |
%.mex: |
| 42 |
mkoctfile $(MKOCTFILE_FLAGS) $($*_LIBS:%=-l%) $($*_SRCS) |
| 43 |
|
| 44 |
endif |
| 45 |
endif |
| 46 |
|
| 47 |
|
| 48 |
# Makefile usage: |
| 49 |
# OCTAVES += abc.mex def.mex |
| 50 |
# abc_SRCS = a1.c a2.c |
| 51 |
# abc_LIBS = ca Com |
| 52 |
# def_SRCS = a3.c a4.c |
| 53 |
# def_LIBS = ca Com |