Makefile.ALL 2.42 KB
#!gnumake 

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

include $(SIMTOOLS)/makedefs

TARGET = solo-aint

VPATH = ..

#################################################################
# INCLUDE DIRECTORIES 
#################################################################
ID1 = -I$(SIMTOOLS)/common/misc
ID2 = -I$(SIMTOOLS)/cpus-alpha/gamma
ID3 = -I$(SIMTOOLS)/cpus-alpha/alpha-shared
ID4 = -I$(SIMTOOLS)/cpus-alpha/solo-aint

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

LIBS = $(SIMTOOLS)/cpus-alpha/gamma/SOLO-AINT/gammalib.a 
LIBS += $(SIMTOOLS)/common/tcl/SOLO-AINT/tcl.a
LIBS += $(SIMTOOLS)/common/symbols/SOLO-AINT/symbols.a
LIBS += $(SIMTOOLS)/common/misc/SOLO-AINT/misc.a
LIBS += $(SIMTOOLS)/common/stats/SOLO-AINT/stats.a
LIBS += $(SIMOS_DIR)/build-files/lib/alpha-shared/libtcl.a

#################################################################
# 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       = main.o mmu.o  gamma_aint.o \
                aint_init.o subst.o tlb.o memory.o ipc.o  symtab.o exec.o queue.o

TARGETS = $(C_TARGETS) 

##
## common-stats are in two different libraries. 
## 

LDFLAGS = -v -u List_Insert -u List_Remove -u List_Init

.PHONY:	warn deps

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

$(TARGET): $(TARGETS)  $(LIBS)
	@echo "Linking solo-aint"
	cc -o solo-aint $(TARGETS) $(LDFLAGS) $(LIBS)  -lmld -lm -lots       

warn:
	@echo ""
	@echo "Making solo-aint"
	@echo "************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo "  INCS:    `$(FORMAT) $(INCS)`"
	@echo "  LDFLAGS: `$(FORMAT) $(LDFLAGS)`"

	@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