##========================================================================================
## Makefile to build the EQUINOX-3D plugins
##
## This directory is a sample that shows you how to set up a local
## EQUINOX-3D plugin development environment.
##
## This is the recommended way of developing your own plugins, as the main EQUINOX-3D
## directory is overwritten when you install an newer version of the software.
##
## AUTHOR:  Gabor Nagy
## DATE:    2016-Mar-14 06:21:50
##
## Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
##========================================================================================

include		../make.defines


TARGETS	=	$(DSO_DIR)/HelloWorld.so


Plugins all:	$(DSO_DIR)\
		$(ICON_DIR)\
		$(TARGETS)


clean:
		rm -f so_locations $(TARGETS) $(OBJ_DIR)/*.o $(OBJ_DIR)/Primitives/*.o $(OBJ_DIR)/Surface/*.o core


## Rules to create the necessary directories if they don't exist yet
##
$(ICON_DIR):
			mkdir -p $@

$(OBJ_DIR):
			mkdir -p $@

$(DSO_DIR):		$(OBJ_DIR)
			mkdir -p $@


## Universal compile rules.
## This should work for relatively simple plugins.
## You can add custom build rules for more complex ones.
##
$(OBJ_DIR)/%.o:			%.c $< $(INCLUDES)
				$(CC) $(CFLAGS) $< -o $@

$(DSO_DIR)/%.so:		$(OBJ_DIR)/%.o
				$(DSO_LD) $(OBJ_DIR)/%.o -o $@


##
## Link rules for the individual plugins
##

##=======================================
## Hello world
##=======================================

$(DSO_DIR)/HelloWorld.so:		$(OBJ_DIR)/HelloWorld.o
				ld -shared $(OBJ_DIR)/HelloWorld.o -o $@
