# Makefile for building a program to compute list reader
# This code was developed in the joint research project APPLY funded by
# the German Ministry of Research and Technology under the project code
# ITW9102D5.
# 
# Copyright 1994-2010 Fraunhofer ISST
# 
# Licensed under the EUPL, Version 1.1 or  as soon they will be approved by the European Commission - subsequent 
# versions of the EUPL (the "Licence");
# 
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at:
# http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 
# See the Licence for the specific language governing permissions and limitations under the Licence.


CC  = gcc
#CC = cc 
#MFLAGS = -DKRC
MFLAGS =
CFLAGS = -O2
ARCHIVE= eu2c-threads.a
STACKTOP= sun4-swch
MEMALLOC =  card.o heap.o heap-init.o trace.o \
	xalloc.o timing.o\
	thread.o\
        c-runtime.o\
	$(STACKTOP).o


# dependencies for constructing Xalloc
$(ARCHIVE):
	$(MAKE) $(MFLAGS) create ARCHIVE=$(ARCHIVE) CFLAGS='$(CFLAGS)'




create: $(MEMALLOC)
	rm -f $(ARCHIVE)
	ar rv $(ARCHIVE) $(MEMALLOC)
	ranlib $(ARCHIVE)


card.o : card.c
	$(CC) -c  $(CFLAGS) card.c

heap.o : heap.c
	$(CC) -c  $(CFLAGS) heap.c

heap-init.o :heap-init.c
	$(CC) -c  $(CFLAGS) heap-init.c
 
trace.o : trace.c
	$(CC) -c  $(CFLAGS) trace.c

xalloc.o:
	$(CC) -c   $(CFLAGS) xalloc.c

timing.o : timing.c
	$(CC) -c   $(CFLAGS) timing.c

thread.o : thread.c
	$(CC) -c   $(CFLAGS) thread.c

c-runtime.o : c-runtime.c
	$(CC) -c   $(CFLAGS) c-runtime.c

$(STACKTOP).o: $(STACKTOP).s
	$(CC) -c  $(CFLAGS) $(STACKTOP).s

clean:
	rm -f *.o








