#
# Make include file for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2024 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file.  If this
# file is missing or damaged, see the license at:
#
#     https://www.fltk.org/COPYING.php
#
# Please see the following page on how to report bugs and issues:
#
#      https://www.fltk.org/bugs.php
#
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
# Modified: Sat Apr 20 11:33:31 WEST 2024 (3rdp4r7yr3p0 <3rdp4r7yr3p0@gmail.com>)
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

PREFIX = /opt/3rdp4r7yr3p0/fltk1.4
FLTK_CONFIG_SCRIPT = ${PREFIX}/bin/fltk-config
FLTK_FLUID_BIN = ${PREFIX}/bin/fluid

# Standard configure variables
BINDIR = ${PREFIX}/bin
DOCDIR = ${PREFIX}/share/doc/fltk

# programs we use...
INSTALL = /usr/bin/install -c
RM = rm -f
RMDIR	= rm -Rf

# compiler names:
CXX	= g++
CC = gcc
MAKEDEPEND = $(CXX) -M

ifeq "$(FLTK_SHAREDLIBS)" "true"
FLTK_LDFLAGS = --ldflags
else
FLTK_LDFLAGS = --ldstaticflags
endif

# flags for C++ compiler:
FLTK_OPTIONS = --use-cairo --use-forms --use-gl --use-glut --use-images
PKGCONFIG_LIBS = cairo egl gl glu pango wayland-cursor wayland-egl
OPTIM = -O2 -pipe -Wall -Wunused -Wno-format-y2k  -fno-exceptions -fno-strict-aliasing -ffunction-sections -fdata-sections -s
CFLAGS = $(OPTIM) -I. $(shell $(FLTK_CONFIG_SCRIPT) --cflags $(FLTK_OPTIONS)) $(shell pkg-config --cflags $(PKGCONFIG_LIBS))
CXXFLAGS = $(OPTIM) -I. $(shell $(FLTK_CONFIG_SCRIPT) --cxxflags $(FLTK_OPTIONS)) $(shell pkg-config --cflags $(PKGCONFIG_LIBS))

# libraries to link with:
AUDIOLIBS	= -lasound
LDFLAGS	= $(OPTIM) -rdynamic
LDLIBS = $(shell $(FLTK_CONFIG_SCRIPT) $(FLTK_LDFLAGS) $(FLTK_OPTIONS)) $(shell pkg-config --libs $(PKGCONFIG_LIBS))

# Installation programs...
INSTALL_BIN	= $(INSTALL) -m 755
INSTALL_DATA	= $(INSTALL) -m 644
INSTALL_DIR	= $(INSTALL) -d

# Be quiet when building...
.SILENT:

# Build commands and filename extensions...
.SUFFIXES: .c .cxx .h .fl .o

.o:
	echo Linking $@...
	$(CXX) $(LDFLAGS) $< $(LDLIBS) -o $@
	$(FLTK_CONFIG_SCRIPT) --post $@

.c.o:
	echo Compiling $<...
	$(CC) $(CFLAGS) -c $< -o $@

.cxx.o:
	echo Compiling $<...
	$(CXX) $(CXXFLAGS) -c $< -o $@
