GNUmakefile 1.64 KB
#!smake
#
# $Revision: 1.14 $
#

PRDEPTH = ../..
include $(PRDEPTH)/PRdefs

COMMONPREF = iosim
SUBDIRS = mi_test pi_test jtag_test random si_test

IOSIMLIB	= libiosim.a
IOSIMBIN	= iosim 
IORAND		= iorand 
IOSIMUTIL	= tst2c 

TARGETS		= $(IOSIMLIB) $(IORAND) $(IOSIMBIN) $(IOSIMUTIL) subdirs

CFILES	= \
	address.c misc.c iomap.c socket.c iotest.c iotestcmd.c iomem.c \
	iotestebus.c iotestri.c iotestpi.c iotestsi.c \
	iotestai.c iotestsp.c iotestrdp.c iotestram.c bcp_util.c bcptestri.c \
	bcp_si.c bcptestsi.c bcp_usb.c bcp_rand_tests.c nvram.c

#
# C Flags
#
LCINCS	= -Wall -I. -I$(ROOT)/host_include -I$(ROOT)/usr/include/PR -D_LANGUAGE_C
LCOPTS	= -g -DDEBUG -DBCP_IPC
LCFLAGS = $(LCOPTS) $(LCINCS)
CC=$(HOST_CC)

#
# Linker Flags
#
LLDLIBS	= $(IOSIMLIB) 

default: $(TARGETS)

include $(COMMONRULES)

$(COMMONTARGS): $(COMMONPREF)clean $(COMMONPREF)clobber $(COMMONPREF)rmtargets
	$(SUBDIRS_MAKERULE)

install: default
	$(INSTALL) -m 555 -F /usr/sbin $(IORAND) $(IOSIMBIN)

$(IOSIMLIB):	sim.h simipc.h iotest.h iomap.h main.o $(OBJECTS)
		$(AR) rc $@ $(OBJECTS)

$(IORAND):	sim.h simipc.h iotest.h iomap.h randmain.o randtest.o sync.o $(IOSIMLIB)
		$(CC) -o $@ randmain.o randtest.o sync.o $(LLDLIBS)

$(IOSIMBIN):	sim.h simipc.h iotest.h iomap.h main.o syncstub.o $(IOSIMLIB)
		$(CC) -o $@ main.o syncstub.o $(LLDLIBS)

$(IOSIMUTIL):	sim.h simipc.h iotest.h iomap.h tst2c.o syncstub.o $(IOSIMLIB)
		$(CC) -o $@ tst2c.o syncstub.o $(LLDLIBS)

tstsim:		sim.h iotest.h iomap.h tstsim.o test.o $(IOSIMLIB)
		$(CC) -o $@ tstsim.o test.o $(LLDLIBS)

.PHONY: subdirs $(SUBDIRS)

subdirs: $(SUBDIRS)

$(SUBDIRS): $(IOSIMLIB)
	$(MAKE) -C $@

.c.o:
	$(HOST_CC) $(LCFLAGS) -c $<