Makefile.ALL 1.38 KB
#!gmake

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

include $(SIMTOOLS)/makedefs

VPATH = ..

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

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

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

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

C_TARGETS = ethersim.o ethersim_output.o ethersim_init.o ethersim_simport.o \
        arpd.o ethersim_netport.o

TARGETS   = $(C_TARGETS) $(SIMTOOLS)/apps/unix/ethersim/common/sprite_support.a

ifdef SIMOS
ifeq ($(CPU),SGI)
GOAL = simos
else
GOAL = 
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: ethersim

ethersim:  $(TARGETS)
	@echo "-> Making Ethersim"
	$(CC) $(CC_OPTS) -o ../ethersim $(TARGETS)

warn:
	@echo ""
	@echo "Making Ethersim for $(CPU)"
	@echo "***************************"
	@echo "  DEFS :   `$(FORMAT) $(DEFS)`"
	@echo "  CFLAGS : `$(FORMAT) $(CFLAGS)`"
	@echo ""

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

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

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

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