1 # 2 # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 3 # Use is subject to license terms. 4 # 5 # Copyright (c) 2018, Joyent, Inc. 6 7 include ../../Makefile.cmd 8 9 PROG = neqn 10 11 CSRCS = diacrit.c eqnbox.c font.c fromto.c funny.c \ 12 glob.c integral.c io.c lex.c lookup.c \ 13 mark.c matrix.c move.c over.c paren.c \ 14 pile.c shift.c size.c sqrt.c text.c 15 16 SRCS = $(CSRCS:%=../%) 17 18 YACCSRC = e.y 19 20 COBJS = $(CSRCS:%.c=%.o) 21 OBJS = $(YACCSRC:%.y=%.o) $(COBJS) 22 23 24 CLEANFILES = y.tab.c y.tab.h $(YACCSRC:%.y=%.c) $(YACCSRC:%.y=%.def) 25 26 YFLAGS = -d 27 CPPFLAGS = -DNEQN -I. -I.. $(CPPFLAGS.master) 28 LDFLAGS += $(MAPFILE.NGB:%=-M%) 29 30 CERRWARN += -_gcc=-Wno-implicit-function-declaration 31 CERRWARN += $(CNOWARN_UNINIT) 32 CERRWARN += -_gcc=-Wno-unused-label 33 34 # not linted 35 SMATCH=off 36 37 # 38 # for message catalog 39 # 40 POFILE= neqn.d.po 41 POFILES= e.po 42 43 .KEEP_STATE: 44 45 all : $(PROG) 46 47 $(PROG) : $(OBJS) $(MAPFILE.NGB) 48 $(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) 49 $(POST_PROCESS) 50 51 catalog: $(POFILE) 52 53 $(POFILE): $(POFILES) 54 $(RM) $@ 55 cat $(POFILES) > $@ 56 57 58 $(YACCSRC:%.y=%.c) + $(YACCSRC:%.y=%.def) : ../$(YACCSRC) 59 $(YACC.y) ../$(YACCSRC) 60 $(MV) y.tab.c $(YACCSRC:%.y=%.c) 61 $(MV) y.tab.h $(YACCSRC:%.y=%.def) 62 63 $(COBJS) : $$(@:%.o=../%.c) 64 $(COMPILE.c) ../$(@:%.o=%.c) 65 66 install : all $(ROOTPROG) 67 68 clean: 69 $(RM) $(OBJS) $(CLEANFILES) 70 71 lint: lint_SRCS 72 73 strip : 74 $(STRIP) $(PROG) 75 76 include ../../Makefile.targ