$NetBSD: patch-af,v 1.4 2017/05/09 14:46:55 jperkin Exp $ --- sys/bsd/Makefile.orig 1988-07-03 17:50:59.000000000 +0000 +++ sys/bsd/Makefile @@ -17,8 +17,8 @@ LIBS = -ltermcap # REGEX -- create regular expression functions # #CDEFS = -DDO_METAKEY -CDEFS = -DDO_METAKEY -DPREFIXREGION -CFLAGS = -g $(CDEFS) +CDEFS = -DDO_METAKEY -DPREFIXREGION -DSTARTUPFILE=\"mg.rc\" -DNO_BACKUP -DSYMBLINK +CFLAGS += $(CDEFS) # Objects which only depend on the "standard" includes OBJS = basic.o dir.o dired.o file.o line.o match.o paragraph.o \ @@ -42,8 +42,14 @@ SRCS = basic.c dir.c dired.c file.c line OINCS = ttydef.h sysdef.h chrdef.h INCS = def.h +# refling - added these and the @ for peace and quiet. All $(RM) and +# $(LN) below are mine! Also added the all target for NetBSD pkgs. + +RM = @rm -f +LN = @ln + mg: $(OBJ) - cc $(CFLAGS) -o mg $(OBJ) $(LIBS) + gcc $(CFLAGS) -o mg $(OBJ) $(LDFLAGS) $(LIBS) # strip mg once you're satisfied it'll run -- makes it much smaller strip: @@ -75,44 +81,52 @@ echo.o: $(INCS) $(OINCS) key.h macro.h $(OOBJS): $(INCS) $(OINCS) sysdef.h: sys/$(SYS)/sysdef.h # Update links, if needed. - rm -f sysdef.h - ln sys/$(SYS)/sysdef.h . + $(RM) sysdef.h + $(LN) sys/$(SYS)/sysdef.h . ttydef.h: sys/default/ttydef.h - rm -f ttydef.h - ln sys/default/ttydef.h . + $(RM) ttydef.h + $(LN) sys/default/ttydef.h . chrdef.h: sys/default/chrdef.h - rm -f chrdef.h - ln sys/default/chrdef.h . + $(RM) chrdef.h + $(LN) sys/default/chrdef.h . fileio.c: sys/$(SYS)/fileio.c - rm -f fileio.c - ln sys/$(SYS)/fileio.c . + $(RM) fileio.c + $(LN) sys/$(SYS)/fileio.c . spawn.c: sys/$(SYS)/spawn.c - rm -f spawn.c - ln sys/$(SYS)/spawn.c . + $(RM) spawn.c + $(LN) sys/$(SYS)/spawn.c . tty.c: sys/default/tty.c - rm -f tty.c - ln sys/default/tty.c . + $(RM) tty.c + $(LN) sys/default/tty.c . ttyio.c: sys/$(SYS)/ttyio.c - rm -f ttyio.c - ln sys/$(SYS)/ttyio.c . + $(RM) ttyio.c + $(LN) sys/$(SYS)/ttyio.c . ttykbd.c: sys/default/ttykbd.c - rm -f ttykbd.c - ln sys/default/ttykbd.c . + $(RM) ttykbd.c + $(LN) sys/default/ttykbd.c . cinfo.c: sys/default/cinfo.c - rm -f cinfo.c - ln sys/default/cinfo.c . + $(RM) cinfo.c + $(LN) sys/default/cinfo.c . port: $(SRCS) $(INCS) - rm -f port + $(RM) port tar cfb port 1 $? -clean:; rm -f $(OBJ) $(OSRCS) $(OINCS) +clean:; $(RM) $(OBJ) $(OSRCS) $(OINCS) mg + +all: $(OBJ) + cc $(CFLAGS) -o mg $(OBJ) $(LIBS) + strip mg +install: + $(INSTALL_PROGRAM) mg $(PREFIX)/bin + $(INSTALL_DATA) mg.rc $(PREFIX)/bin + $(INSTALL_DATA) mg.1 $(PREFIX)/man/man1