# Platform Configurator generated Makefile
#
PREFIX = /usr

CFLAGS = -Wall -O2 -g \
         `imlib-config --cflags` -DHAVE_IMLIB \
         `gtk-config --cflags`

INC_DIRS =

LIBS = -lY2 `imlib-config --libs` `gtk-config --libs`
LIB_DIRS =

CC = cc
CPP = c++

# Appended stuff starts here
#

# C++ flags:
CPPFLAGS = -D__cplusplus -Dc_plusplus

# Source files list:
include Makefile.srclist

# Utilities:
LS      = ls
LSFLAGS = -a -l
RM      = rm
RMFLAGS = -f

# Compiler set up:
BIN     = yconsole
OBJ_C   = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
	+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
.cpp.o:
	+$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)


# Build rules:
EXPORT_COMPILETIMEINFO_H = echo -n -e "\
\#ifndef COMPILETIMEINFO_H\n\
\#define COMPILETIMEINFO_H\n\
\#define COMPILE_COMPILER\t\"`$(CPP) --version`\"\n\
\#define COMPILE_USER\t\t\"$(USER)\"\n\
\#define COMPILE_LOCATION\t\"`uname -n`\"\n\
\#define COMPILE_DATE\t\t`date +\"%s\"`\n\
\#endif\t/* COMPILETIMEINFO_H */\n"

$(BIN): $(OBJ_C) $(OBJ_CPP) 
	$(CPP) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIBS) $(LIB_DIRS)

config:
	$(EXPORT_COMPILETIMEINFO_H) > compiletimeinfo.h

ydspview:
	$(CC) cdialog.c csd.c dspview.c guiutils.c ydspview.c \
	imlibio.c \
	$(CFLAGS) $(LIBS) \
	-o ydspview

all: config $(BIN)


# Install Rules:
include Makefile.install.UNIX


# Maintainance and Misc Rules:
clean:
	$(RM) $(RMFLAGS) a.out core *.o compiletimeinfo.h $(BIN)
