Makefile.ALL 1.51 KB
#!gmake

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

include $(SIMTOOLS)/makedefs

TARGET = symbols.a

VPATH = ..

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

################################################################
# DEFINES
################################################################
DEFS = $(GLOBAL_DEFS)

#################################################################
# C and ASM FLAGS
#################################################################
CFLAGS      = $(GLOBAL_CFLAGS)
ifdef SOLO
CFLAGS += $(SOLOCFLAGS)
endif

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

ifndef USE_SESL
C_TARGETS = assoctab.o symexpr.o symfile.o symtcl.o dwarfread.o
else
C_TARGETS = sesl_expr.o sesl_tcl.o
endif

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 $(TARGET)"
	$(AR) cru $(TARGET) $(TARGETS)

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