Makefile.ALL 2.14 KB
#!gmake 

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

include $(SIMTOOLS)/makedefs

TARGET = deltalib.a

VPATH = ..

#################################################################
# INCLUDE DIRECTORIES 
#################################################################
ID1 = -I$(SIMTOOLS)/common/misc -I$(SIMTOOLS)/common/tcl -I$(SIMTOOLS)/common/stats
ID2 = -I$(SIMTOOLS)/cpus-alpha/delta -I$(SIMTOOLS)/cpus-alpha/gamma
ID3 = -I$(SIMTOOLS)/cpus-alpha/alpha-shared
ID4 = -I$(SIMTOOLS)/common/dcg_support

INCS  = $(ID1) $(ID2) $(ID3) $(ID4)

ifdef EXTERNAL_TRACE
INCS += -I$(EXTERNAL_TRACE_DIR)
endif

#################################################################
# DEFINES
#################################################################

ifdef SOLO
DEF1  = -DSOLO 
else
DEF1 = -DSIMOS
endif

DEFS = $(DEF1) $(GLOBAL_DEFS) 

#################################################################
# C and ASM FLAGS
#################################################################

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

#################################################################
# TARGETS
#################################################################
C_TARGETS       = translator.o decoder.o delta.o emit.o

TARGETS = $(C_TARGETS)

.PHONY:	warn deps

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 SIMOS=1 deps
	@$(MAKE) -f ../Makefile.ALL SIMOS=1 INCLUDE_DEPS=1  $(TARGET)
endif

$(TARGET): ../assym.h $(TARGETS)
	@echo "-> Updating library $(TARGET)"
	$(AR) cru $(TARGET) $(TARGETS)

warn:
	@echo ""
	@echo "Making delta"
	@echo "************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo "  INCS:    `$(FORMAT) $(INCS)`"
	@echo ""


$(C_TARGETS): %.o: %.c 
	@echo "Compiling  $(<F)"
	$(CC) $(CC_OPTS) -c $<


../assym.h: ../genassym.c ../../alpha-shared/alpha.h 
	@echo "Generating assym.h"
	gcc ../genassym.c $(CC_OPTS)
	a.out >../assym.h

deps: ../assym.h ${TARGETS:.o=.d}

%.d:  %.c ../assym.h
	@$(CC) -M $(CC_OPTS) $< > $@

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