GNUmakefile 2.2 KB

#
# Makefile for unix version of ide
#

include $(ROOT)/usr/include/make/commondefs
CC=$(HOST_CC)
CVERSION=
GCINCS=-D_LANGUAGE_C -I$(ROOT)/host_include
YFLAGS=-p yy

LCDEFS = -Dident=undef

#
# Use $(MAKE) $(MAKEARGS) instead of $(MAKEF) so that make -n works
# This gets around the fact that $(MAKE) works and $(MAKEF) does not.
# MAKEARGS is based directly on $(MAKEF) in commondefs.
#
MAKEARGS = VCFLAGS="$(VCFLAGS)" VFFLAGS="$(VFFLAGS)" \
	VPFLAGS="$(VPFLAGS)" VMKDEPFLAGS="$(VMKDEPFLAGS)"

#
# For $(INSTALL) the following "-idb" arguments are used in this tree:
#	pr.sw.diag for diagnostics
#
IDBTAG_DIAGS = pr.sw.diag

LIBIDE=	libide.a
DIAGCMD=diagcmd

LCOPTS=	-g3
#STDINC=	$(ROOT)/usr/include
STDINC=	/usr/include
IDEINC=	$(ROOT)/usr/include/ide
LCINCS=	-I$(IDEINC) -I$(STDINC)

OBJS = \
	ide_alloc.o \
	ide_cmds.o \
	ide_env.o \
	ide_errlog.o \
	ide_gram.o \
	ide_init.o \
	ide_lex.o \
	ide_main.o \
	ide_run.o \
	ide_startup.o \
	ide_sym.o \
	$(DIAGCMD).o

default all: $(LIBIDE)

install: $(LIBIDE)

$(LIBIDE): $(OBJS)
	$(AR) -ruv $(LIBIDE) $(OBJS)

clean:
	rm -f $(OBJS) $(DIAGCMD).c ide_gram.c ide_gram.h ide_startup.c

clobber:clean
	rm -f $(LIBIDE) Makedepend

$(DIAGCMD).o: \
	$(DIAGCMD).c \
	$(IDEINC)/ide.h

$(DIAGCMD).c: $(DIAGCMD).awk
	$(NAWK) -v FILENAME=$(DIAGCMD).awk -F'\t[\t ]*' -f builtins.awk $(DIAGCMD).awk > $(DIAGCMD).c

$(DIAGCMD):
	;

ide_alloc.o: \
	ide_alloc.c \
	$(IDEINC)/ide.h

ide_cmds.o: \
	ide_cmds.c \
	$(IDEINC)/ide.h \
	$(IDEINC)/diag.h \
	$(IDEINC)/dbg_comm.h

ide_env.o: \
	ide_env.c \
	$(IDEINC)/ide.h \
	$(IDEINC)/diag.h \
	$(IDEINC)/dbg_comm.h

ide_errlog.o: \
	ide_errlog.c \
	$(IDEINC)/diag.h

ide_gram.o: \
	ide_gram.c \
	$(IDEINC)/ide.h

ide_init.o: \
	ide_init.c \
	$(IDEINC)/diag.h

ide_lex.o: \
	ide_lex.c \
	$(IDEINC)/ide.h \
	ide_gram.h

ide_main.o: \
	ide_main.c \
	$(IDEINC)/ide.h

ide_run.o: \
	ide_run.c \
	$(IDEINC)/ide.h \
	$(IDEINC)/diag.h

ide_startup.o: \
	ide_startup.c

ide_sym.o: \
	ide_sym.c \
	$(IDEINC)/ide.h

ide_gram.c: \
	ide_gram.h

ide_gram.h: \
	ide_gram.y
	$(YACC) -d ide_gram.y
	mv y.tab.c ide_gram.c
	cmp -s y.tab.h ide_gram.h || mv y.tab.h ide_gram.h
	rm -f y.tab.h

ide_startup.c: \
	unixstartup
	sed 's/"/\\"/g' unixstartup | $(NAWK) -f startup.awk > ide_startup.c