Makefile.ALL 1.69 KB
ifndef SIMTOOLS
SIMTOOLS = ../../..
endif

include $(SIMTOOLS)/makedefs

TARGET = misc.a

VPATH = ..

################################################################
# INCLUDES
################################################################
INCS        = $(GLOBAL_INCS)

################################################################
# DEFINES
################################################################
DEF1 = 
ifdef USE_FLASHLITE
DEF2 = -DUSE_FLASHLITE
endif
ifdef SOLO
DEF3 = -DSOLO
endif
DEFS = $(DEF1) $(DEF2) $(DEF3) $(DEF4) $(GLOBAL_DEFS)


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

C_TARGETS   = sim_error.o eventcallback.o simutil.o registry.o\
                List_Remove.o List_Error.o List_Init.o List_Insert.o \
                hw_events.o gdb_interface.o remote_access.o checkpoint.o \
                visual.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): $(TARGETS)
	@echo "-> Updating library misc.a"
	$(AR) cru $(TARGET) $(TARGETS)

warn:
	@echo ""
	@echo "Making common/misc"
	@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