# Mods A-P Virtanen for GNU-make Dec-92

#
# Mach Operating System
# Copyright (c) 1992 Carnegie Mellon University
# All Rights Reserved.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
# 
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
# 
# Carnegie Mellon requests users of this software to return to
# 
#  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
#  School of Computer Science
#  Carnegie Mellon University
#  Pittsburgh PA 15213-3890
# 
# any improvements or extensions that they make and grant Carnegie Mellon
# the rights to redistribute these changes.
#  
#
# HISTORY
# $Log:	Makefile,v $
# Revision 2.4  92/02/15  19:44:29  rpd
# 	Moved include file installation to user/include/Makefile.
# 	[92/02/15            rpd]
# 
# Revision 2.3  92/01/24  18:11:51  rpd
# 	Fixed to include Makefile-servers before Makefile-lib.
# 	[92/01/24            rpd]
# 
# Revision 2.2  92/01/22  23:16:54  rpd
# 	Created.
# 	[92/01/17            rpd]
# 

#include ${MAKETOP}Makefile-common

# routines from service.defs

INCDIR = /usr/local/pc532-mach/DIST/include
INCLUDES= -nostdinc -I. -I$(INCDIR) -I/usr/local/pc532-mach/bsdss/server -I/usr/antsu/src/net/include

DEFINES = -DMACH_IPC_COMPAT=0 -DSTANDALONE -DMACH -DPC532 -Dns532
CFLAGS = $(DEFINES) $(INCLUDES) -O
MIGFLAGS = $(MIGOPTS) $(DEFINES) $(INCLUDES)
SERVICE_ROUTINES = service_checkin service_waitfor



CPP = /usr/local/lib/gcc-lib/pc532-mach/2.3.1/cpp
CC=gcc32k
AS=as32k
AR=ar32k
RANLIB=ranlib32k
MIG=/usr/local/pc532-mach/DIST/bin/mig


all: libservice.a

# mig rules

#SERVICE_USER_SRCS = ${SERVICE_ROUTINES/.*/&.c}

SERVICE_USER_SRCS = $(addsuffix .c, $(SERVICE_ROUTINES))
SERVICE_SRCS = service.h ${SERVICE_USER_SRCS} service_server.c

${SERVICE_SRCS} : service.defs
	${MIG} ${MIGFLAGS} -i ./ -user '$${SERVICE_USER_SRCS}' -server service_server.c service.defs

# use Makefile-lib for most of the rules

#OBJECTS = service_server.o ${SERVICE_ROUTINES/.*/&.o}

OBJECTS = service_server.o $(addsuffix .o, $(SERVICE_ROUTINES))

libservice.a : ${OBJECTS}
	${RM} $@
	${AR} cq $@ ${OBJECTS}
	${RANLIB} $@

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


#include ${MAKETOP}Makefile-lib
#-include Makedep
