Makefile.ALL 1.78 KB
#!gmake

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

include $(SIMTOOLS)/makedefs

TARGET = tcl.a

VPATH = ..

################################################################
# INCLUDES
################################################################
INCS = -I$(SIMTOOLS)/common/symbols $(GLOBAL_INCS) 

################################################################
# DEFINES
################################################################
ifdef USE_FLASHLITE
DEF1 = -DUSE_FLASHLITE
endif
ifdef SOLO
DEF2 = -DSOLO 
endif
ifeq ($(CPU),SGI)
ifdef PROFILING
DEF3 = -DPROFILING_ON
endif
endif
ifeq ($(CPUSIM),mxs)
DEF4 = -DMIPSY_MXS
endif

ifdef USE_TCL8
DEF5 = -DTCL8
endif

DEFS = $(DEF1) $(DEF2) $(DEF3) $(DEF4) $(DEF5) $(GLOBAL_DEFS)


#################################################################
# C and ASM FLAGS
#################################################################
CFLAGS      = $(GLOBAL_CFLAGS)
CC_OPTS     = $(CFLAGS) $(INCS) $(DEFS)

C_TARGETS =  annotations.o selectors.o details.o statistics.o \
        tcl_init.o timing.o stack.o  profile.o expect.o \
	params.o simos_vars.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 deps
	@$(MAKE) -f ../Makefile.ALL INCLUDE_DEPS=1  $(TARGET)
endif

$(TARGET): $(C_TARGETS)
	@echo "-> Updating $(TARGET)"
	$(AR) cru $(TARGET) $(C_TARGETS)

warn:
	@echo ""
	@echo "Making common/tcl"
	@echo "*****************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo ""

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


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

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

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