#######################
#### Start of File ####
#######################
# ---------------------------------------------------------------
# Makefile Contents: make file to build the DataReel library subset
# C/C++ Compiler Used: GNU
# Produced By: DataReel Software Development Team
# File Creation Date: 05/25/2001
# Date Last Modified: 10/25/2026
# ---------------------------------------------------------------
# Only the DataReel 6.4 components used by DRLB are kept in ../src
# and ../include. Every ../src/*.cpp file is built into a static
# library. Header dependencies are generated by the compiler.
# ---------------------------------------------------------------
GCODE_LIB_DIR = ..

include ../env/linux.env

# Define a name for the static library
PROJECT = libdatareel

ifeq ($(USE_OPEN_SSL),YES)
PROJECT = libdatareel_ssl
endif

COMPILE_FLAGS := $(COMPILE_FLAGS) $(LIBCOMPILE_FLAGS) -MMD -MP

SOURCES = $(wildcard ../src/*.cpp)
OBJECTS = $(notdir $(SOURCES:.cpp=$(OBJ_EXT)))

all: $(PROJECT)$(LIB_EXT)

%$(OBJ_EXT): ../src/%.cpp
	$(CXX) $(COMPILE_ONLY) $(COMPILE_FLAGS) $<

$(PROJECT)$(LIB_EXT): $(OBJECTS)
	rm -f ./$(PROJECT)$(LIB_EXT)
	$(LIBUTIL) $(LIBUTIL_FLAGS) ./$(PROJECT)$(LIB_EXT) $(OBJECTS)
	$(RANLIB_UTIL) ./$(PROJECT)$(LIB_EXT)

-include $(OBJECTS:$(OBJ_EXT)=.d)

install: $(PROJECT)$(LIB_EXT)
	rm -f $(LIB_INSTALL_DIR)/$(PROJECT)$(LIB_EXT)
	cp $(PROJECT)$(LIB_EXT) $(LIB_INSTALL_DIR)/$(PROJECT)$(LIB_EXT)

clean:
	rm -f *$(OBJ_EXT) *.d
	rm -f $(PROJECT)$(LIB_EXT)

clean_lib:
	rm -fv $(LIB_INSTALL_DIR)/libdatareel.a $(LIB_INSTALL_DIR)/libdatareel_ssl.a
# ---------------------------------------------------------------
#####################
#### End of File ####
#####################
