head     1.2;
access   ;
symbols  KSUrelease-Aug93:1.2;
locks    ; strict;
comment  @# @;


1.2
date     93.08.10.12.09.46;  author bill;  state Exp;
branches ;
next     1.1;

1.1
date     89.12.14.13.25.40;  author jay;  state Exp;
branches ;
next     ;


desc
@@


1.2
log
@minor changes
@
text
@# Makefile for binaries.

.PHONY: all dirs saber tags TAGS

ifdef ARCH

ARCHBIN := $(ARCH)/$(BIN)
ARCHOBJS := $(addprefix $(ARCH)/,$(OBJS))

# Nasty bit of hackery to stick the architecture in all the libraries, ie:
# 		foo.a -lm ../bar.a
# becomes
#		sun3/foo.a ../sun3/bar.a -lm
#
# NOTE -- the order of the libraries is not retained ("-l"s are put at 
#         the end).  If someone can figure out how to do this right, please 
#         do.
RLIBS := $(filter-out -l%,$(LIBS))
OLIBS := $(filter -l%,$(LIBS))
XX1 := $(addsuffix $(ARCH)/,$(dir $(RLIBS)))
XX2 := $(notdir $(RLIBS))
ARCHLIBS := $(join $(XX1),$(XX2)) $(OLIBS)

all: dirs $(ARCHBIN)

$(ARCHBIN): $(ARCHOBJS) FRC
	$(CC) $(LFLAGS) $(ARCHOBJS) $(ARCHLIBS) $(TAILLIBS) -o $@@

FRC::

clean:
	-rm -f $(ARCHOBJS) $(ARCHBIN)

.PHONY: $(BIN)
$(BIN): $(ARCH)/$(BIN)

install:
	if [ -x $(BINDIR)/$(BIN) ]; then mv $(BINDIR)/$(BIN) $(BINDIR)/$(BIN).old; fi
	cp $(ARCH)/$(BIN) $(BINDIR)/$(BIN)

else

all: dirs $(BIN)

$(BIN): $(OBJS) $(LIBS)
	$(CC) $(LFLAGS) $(OBJS) $(LIBS) $(TAILLIBS) -o $@@

clean:
	-rm -f $(OBJS) $(BIN)

install:
	mv $(BINDIR)/$(BIN) $(BINDIR)/$(BIN).old
	cp $(BIN) $(BINDIR)/$(BIN)

endif

saber:
	%load $(CFLAGS) $(SRCS) $(SFLAGS)

TAGSRCS := $(SRCDIR)/h/*.h *.c $(patsubst %,$(SRCDIR)/empmain/%/*.c,$(DIRS))

tags:
	@@echo "Making tags in $(SRCDIR)/h . $(DIRS)..."
	@@ctags $(TAGSRCS)
	@@echo "done."

TAGS:
	@@echo "Making tags in $(SRCDIR)/h . $(DIRS)..."
	@@etags $(TAGSRCS)
	@@echo "done."
@


1.1
log
@Initial revision
@
text
@d38 1
a38 1
	rm -f $(BINDIR)/$(BIN)
d52 1
a52 1
	rm -f $(BINDIR)/$(BIN)
@
