blob: b8816a25f89543e7a9c9f671026109f045318237 [file] [log] [blame]
# Makefile for the PARSEC hooks library
#
# Copyright (C) 2006-2009 by Princeton University
# Author: Christian Bienia
PREFIX=${PARSECDIR}/pkgs/libs/hooks/inst/${PARSECPLAT}
LIBTOOL=${PARSECDIR}/pkgs/tools/libtool/inst/${PARSECPLAT}/bin/libtool
M5CFLAGS?=-O2 -DM5OP_ADDR=0xFFFF0000 -DM5OP_PIC -Iinclude
INCLUDEDIR=include
TARGET=libhooks.la
OBJS=hooks.lo m5op_x86.lo m5_mmap.lo
all: $(OBJS)
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) -rpath $(PREFIX)/lib
%.lo : %.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -Wall -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -c $<
m5op_x86.lo : m5op_x86.S
$(LIBTOOL) --mode=compile $(CC) $(M5CFLAGS) -o $@ -c $<
m5_mmap.lo : m5_mmap.c
$(LIBTOOL) --mode=compile $(CC) $(M5CFLAGS) -o $@ -c $<
clean:
$(LIBTOOL) --mode=clean rm -f $(OBJS)
$(LIBTOOL) --mode=clean rm -f $(TARGET)
install:
mkdir -p $(PREFIX)/include
install -c $(INCLUDEDIR)/hooks.h $(PREFIX)/include
mkdir -p $(PREFIX)/lib
$(LIBTOOL) --mode=install install -c $(TARGET) $(PREFIX)/lib
$(LIBTOOL) --mode=finish $(PREFIX)/lib
.PHONY: all clean install