
PROG		= sma_consol.code

C++SRCS		= $(wildcard *.cc)
C--SRCS		= $(wildcard *.c)
C++OBJS		= $(subst .cc,.o,$(C++SRCS))
C--OBJS		= $(subst .c,.o,$(C--SRCS))

OBJS		= $(C++OBJS) $(C--OBJS)
ECHO		= smakyecho

CFLAGS		= -Wall -O2 -m68020 -fomit-frame-pointer
C++FLAGS	= -Wall -O2 -m68020 -fomit-frame-pointer
CC			= gcc
C++			= gcc

all: $(PROG)

$(PROG): $(OBJS) Makefile
	gcc -o $(PROG) $(OBJS) -lc++ -lgxx

deps:
	@$(ECHO) Making dependencies for the C++ sources
	@$(C++) -M $(CPPFLAGS) $(C++SRCS) > make-c++.deps

clean:
	@$(ECHO) Cleaning up the object files
	@-rm -f make-c++.deps $(C++OBJS) $(wildcard *.a)

.PHONY : all deps clean

#  Include the dependency file if it does exist. If not, the result will
#  be unpredictable. This is just a trick to be able to `make deps'.

ifeq ("$(wildcard make-c++.deps)", "make-c++.deps ")
include make-c++.deps
endif


