########################################################################
#   Sample ALBERTA Makefile for DIM_OF_WORLD = 5                       #
########################################################################
.PHONY: all

PROGS = ellipt-klein-3-bottle

all: $(PROGS)

DEFAULT = ellipt

prefix = /usr/local
exec_prefix = ${prefix}

# delete line, if the paths are environment variables
ALBERTA_INCLUDE_PATH = ${prefix}/include/alberta
ALBERTA_LIB_PATH = ${exec_prefix}/lib
ALBERTA_LIBEXEC_PATH = ${exec_prefix}/libexec/alberta-3.0.3

# compile flags
#
# run make with "make DEBUG=1" to get debuggable code
#
ifeq ($(DEBUG),1)
CFLAGS = -pipe -O2 -isystem /usr/local/include -fno-strict-aliasing  -O0 -ggdb3 -fno-inline -fno-builtin 
ALBERTA_DEBUG = 1
else
CFLAGS = -pipe -O2 -isystem /usr/local/include -fno-strict-aliasing  
ALBERTA_DEBUG = 0
endif
FFLAGS = 

# link flags (use "-shared" or "-static" to specify ALBERTA library type)
# Default type is "-shared", if the configuration permits it.
# Use "-all-static" to create a standalone, truly static binary.

LDFLAGS =  -lXm -lXt -pthread -Wl,-rpath=/usr/local/lib/gcc11  -L/usr/local/lib/gcc11 -L/usr/local/lib 

# uncomment line for using the debug library
#DEBUG = 1

include $(ALBERTA_LIBEXEC_PATH)/Makefile.alberta

########################################################################
# DFLAGS: DIM_OF_WORLD
########################################################################

DIM_OF_WORLD = 5

########################################################################
# set virtual path
########################################################################
VPATH = ./:../Common

########################################################################
# and now the user's files
########################################################################

# small support library for graphics and command-line parsing
libdemo.a: libdemo.a(cmdline.o geomview-graphics.o)
	/usr/local/bin/ranlib $@
libdemo.a(cmdline.o geomview-graphics.o): alberta-demo.h

# unorientable 3d manifold embedded into 5d
ELLIPT_KLEIN_3_BOTTLE_OFILES = ellipt-klein-3-bottle.o libdemo.a

ellipt-klein-3-bottle: $(ELLIPT_KLEIN_3_BOTTLE_OFILES) \
 $(ALBERTA_INCLUDE_PATH)/alberta.h
	$(LINK) $(ELLIPT_KLEIN_3_BOTTLE_OFILES) $(LIBS)

################################################################################

.PHONY: clean realclean new

clean: albertaclean
	-rm -f $(PROGS) libdemo.a

realclean: clean albertarealclean

new: albertanew
