# Skeleton Makefile for the GNU malloc code
#
# Maybe this should really create a library instead of just compiling
# source files

srcdir = .
VPATH = .:$(srcdir)

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(CFLAG_DEF) -c $<

.s.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(CFLAG_DEF) -c $<

MALLOC_SOURCE = malloc.c

ALLOCA_SOURCE = alloca.c
ALLOCA_OBJECT = alloca.o

malloc.o: malloc.c getpagesize.h

$(ALLOCA_OBJECT): $(ALLOCA_SOURCE)

alloca.o:	$(ALLOCA_SOURCE)
	$(CC) $(CFLAGS) $(CPPFLAGS) $(CFLAG_DEF) -c $<
	@- if [ "$(ALLOCA_OBJECT)" != alloca.o ]; then \
		mv $(ALLOCA_OBJECT) alloca.o >/dev/null 2>&1 ; \
	fi
