######################################################################
# User Makefile sample for the Source Navigator / Introl Compiler Env.
#
# KoaLib215 Package
#
# Copyright (C) 2000 K-TEAM S.A.
#
######################################################################

# Packages needed by the compiler (must be on the network)
# (DO NOT forget the / at the end).
exeprefix = m68k-none-elf
gccversion = 2.95.2
prefix = /home/kros/kros-i686-pc-linux-gnu21/
sft_pack = /home/kros/kteam/
hdw_pack = /home/kros/koapack115/

# Hardware Debug Settings
port	= COM1
speed	= 19200

# Hierachical structure for separating source/object/binary
# (DO NOT forget the / at the end).
srcdir	= ./
asmdir = ./
includedir = ./
objdir = ./
libdir = ./
bindir = ./

# Include the master makefile
# (PLEASE do not modify)
include $(sft_pack)etc/Makefile_PIC

# Libraries for linkage
LOADLIBES = $(SUPPLIB) -lgcc -lstdc++ -liostream -lio -lktdebug -lc -lkbus -lglue -lc -lkernel -lc -lglue -lm -lgcc

# Assembler Options:
#   --register-prefix-optional: avoid adding a % in front of
#     register name (%a0-%a7,%d0-%d7)
#   -pic: generate position independent code
#   --bitwise-or: do not treat `|' as a comment character
ASFLAGS = --bitwise-or -pic --register-prefix-optional

# Linker Executable (gcc or g++ according to the language)
LINKER =  $(prefix)/bin/$(exeprefix)-g++

# Linker Options:
#   --embedded-relocs: Generate embedded relocs
#   --cref: Output cross reference table
LDFLAGS = --embedded-relocs

# C Compiler Options:
# other gcc options...
CFLAGS    = -Wall -O3

# This is a way to automatically find the main source code 
# and its dependencies, suppress if not needed.
OBJ = $(addsuffix .o,$(basename $(shell ls -I *.c *.s *.S *.cc 2>null)))
INC = $(addsuffix .o,$(basename $(shell ls -I *.h 2>null)))
EXE = $(addsuffix .s37,$(basename $(shell grep -wl main *.c *.s *.S *.cc 2>null)))


all: $(EXE)
	@echo Compilation done
	@rm null

$(EXE): $(OBJ)

clean:
	@echo Cleaning...
	@rm $(EXE)

