Makefile.ALL 1.66 KB
#!gmake

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

include $(SIMTOOLS)/makedefs

VPATH = ..

################################################################
# Include Files
################################################################
INCS   = 

ifdef SIMOS
DEF1 = -DSIMOS
endif
DEFS = $(DEF1) $(GLOBAL_DEFS)

CFLAGS	 = -I$(SIMTOOLS)/apps/unix/ethersim/common

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

C_TARGETS = Hash.o  Hash_DeleteTable.o Hash_InitTable.o HashChainSearch.o \
Hash_EnumFirst.o  Hash_PrintStats.o Hash_CreateEntry.o Hash_EnumNext.o \
Hash_DeleteEntry.o Hash_FindEntry.o \
List_Init.o List_ListInsert.o List_Remove.o List_Insert.o List_Move.o \
panic.o \


TARGETS   = $(C_TARGETS)

ifdef SIMOS
ifeq ($(CPU),SGI)
GOAL = simos
else
GOAL = simos-sun
endif
endif

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

simos: sprite_support.a

simos-sun: sprite_support-sun.a

sprite_support.a:  $(TARGETS)
	@echo "-> Updating sprite_support.a"
	$(AR) cru ../sprite_support.a $(TARGETS)

sprite_support-sun.a: $(TARGETS)
	@echo "-> Updating sprite_support-sun.a"
	$(AR) cru ../sprite_support-sun.a $(TARGETS)

warn:
	@echo ""
	@echo "Making Sprite Support Lib"
	@echo "***************************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo ""

$(C_TARGETS): %.o: $(SIMTOOLS)/apps/unix/ethersim/common/%.c
	@echo "Compiling  $(<F)"
	$(CC) $(CC_OPTS) -c $(SIMTOOLS)/apps/unix/ethersim/common/$*.c 

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

%.d: %.c
	@echo "Finding dependencies of $(<F)"
	@$(CC) -M $(CC_OPTS) $< > $@

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