Makefile.ALL 1.58 KB
#!gmake

ifndef SIMTOOLS
SIMTOOLS = ../../..
endif

include $(SIMTOOLS)/makedefs

TARGET = memsysmisc.a
VPATH = ..

################################################################
# Include Files
################################################################
#INCS   = -I$(SIMTOOLS)/cpus/mipsy -I$(SIMTOOLS)/cpus/simos -I$(SIMTOOLS)/cpus/solo \
#         -I$(SIMTOOLS)/caches/2Level -I$(SIMTOOLS)/common/tcl \
#	 -I$(SIMTOOLS)/memsystems -I$(SIMTOOLS)/cpus/shared $(GLOBAL_INCS)

INCS = -I$(SIMTOOLS)/memsystems -I$(SIMTOOLS)/caches/2Level  $(GLOBAL_INCS) 
ifdef SOLO
INCS += -I$(SIMTOOLS)/cpus/solo
endif

ifdef SOLO
DEF1 = -DSOLO
endif
DEFS = $(DEF1) $(DEF2) $(GLOBAL_DEFS)

CFLAGS	 += $(GLOBAL_CFLAGS) 

CC_OPTS      = $(CFLAGS) $(INCS) $(DEFS)

C_TARGETS = perfectmem.o busuma.o numa.o common.o


TARGETS   = $(C_TARGETS)

default: warn
ifdef SOLO
	@$(MAKE) -f ../Makefile.ALL SOLO=1 deps
	@$(MAKE) -f ../Makefile.ALL SOLO=1 INCLUDE_DEPS=1 $(TARGET)
else
	@$(MAKE) -f ../Makefile.ALL deps
	@$(MAKE) -f ../Makefile.ALL INCLUDE_DEPS=1 $(TARGET)
endif

$(TARGET):  $(TARGETS)
	@echo "-> Updating memsys.a"
	$(AR) cru $(TARGET)  $(TARGETS)


warn:
	@echo ""
	@echo "Making Misc. Memory Systems"
	@echo "***************************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo ""

$(C_TARGETS): %.o: $(SIMTOOLS)/memsystems/misc/%.c
	@echo "Compiling  $(<F)"
	$(CC) $(CC_OPTS) -c $(SIMTOOLS)/memsystems/misc/$*.c 

deps: ${TARGETS:.o=.d}

%.d: %.c
	@echo "Finding dependencies of $(<F)"
	@$(CC) -M $(CC_OPTS) $< > $@

ifdef INCLUDE_DEPS
include ${TARGETS:.o=.d}
endif