diff --git a/elks/Makefile-rules b/elks/Makefile-rules index 861c42216..ce2e25a76 100644 --- a/elks/Makefile-rules +++ b/elks/Makefile-rules @@ -1,6 +1,6 @@ ######################################################################## # # -# Standard rulesets for use when compiling and installing this system. # +# Standard rulesets for use when compiling the ELKS kernel. # # # ######################################################################## diff --git a/elkscmd/Applications b/elkscmd/Applications index ef32fd37c..367e86571 100644 --- a/elkscmd/Applications +++ b/elkscmd/Applications @@ -88,7 +88,7 @@ sys_utils/kill :sysutil :360c :720k sys_utils/ps :sash :sysutil :360k :128k :nocomp sys_utils/ps :::uptime :sysutil :128k :1440k sys_utils/makeboot :sysutil :360k -sys_utils/man :sysutil :1200k +sys_utils/man :sysutil sys_utils/meminfo :sash :sysutil :360k :128k sys_utils/mouse :sysutil :1200c :1440k sys_utils/passwd :sysutil :1200k diff --git a/elkscmd/Make.rules b/elkscmd/Make.rules deleted file mode 100644 index 3f0744018..000000000 --- a/elkscmd/Make.rules +++ /dev/null @@ -1,3 +0,0 @@ -# Commands common rules - -.PHONY: all clean install diff --git a/elkscmd/Makefile b/elkscmd/Makefile index 3d1bcbd99..8639df509 100644 --- a/elkscmd/Makefile +++ b/elkscmd/Makefile @@ -6,7 +6,7 @@ BASEDIR = . -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### # @@ -47,8 +47,6 @@ SUBDIRS = \ # # Compile everything. -include $(BASEDIR)/Make.rules - all: @if [ ! -e $(TOPDIR)/include/autoconf.h ]; \ then echo -e "\n*** ERROR: You must configure ELKS first ***\n" >&2; exit 1; fi diff --git a/elkscmd/Make.defs b/elkscmd/Makefile-rules similarity index 72% rename from elkscmd/Make.defs rename to elkscmd/Makefile-rules index c0fd8f98a..95cfe4f9a 100644 --- a/elkscmd/Make.defs +++ b/elkscmd/Makefile-rules @@ -1,28 +1,11 @@ -# ***** IMPORTANT NOTE ***** -# -# This file has been revised to remove the requirement that the elkscmd -# and elks trees are located under /usr/src on the developer's system. -# This requires that the variable BASEDIR be defined in every Makefile -# that includes this header file, prior to including it, and the value -# given to BASEDIR is required to be the relative path from the directory -# containing that Makefile to the directory containing this file. -# -# In addition, if there are any local definitions that need including in -# the CFLAGS value, those should be assigned to LOCALFLAGS before including -# this file. -# -# So as to ensure this, it is recommended that the following three lines -# be used as the first three lines of each Makefile including this file: -# -# BASEDIR = ... -# -# LOCALFLAGS = ... -# -# include $(BASEDIR)/Make.defs -# -# This ensures that the correct value is assigned by using it to include -# this file. -# +############################################################################## +# # +# Standard rulesets for use when compiling ELKS applications. # +# # +# This file should be included in every Makefile below elkscmd/ via e.g.: # +# BASEDIR=.. # +# include $(BASEDIR)/Makefile-rules # +# # ############################################################################## ifndef TOPDIR @@ -42,11 +25,6 @@ ELKSCMD_DIR=$(TOPDIR)/elkscmd INCLUDES=-I$(TOPDIR)/include -I$(TOPDIR)/libc/include -I$(ELKS_DIR)/include -# temporarily turn off typical non-K&R warnings for now -WARNINGS = -Wno-implicit-int -# temporarily turn off suggesting parenthesis around assignment used as truth value -WARNINGS += -Wno-parentheses - ############################################################################## # # Determine the ELKS kernel version. @@ -77,6 +55,11 @@ ifeq ($(CONFIG_APPS_FTRACE), y) CLBASE += -finstrument-functions-simple -maout-symtab endif +# temporarily turn off typical non-K&R warnings for now +WARNINGS = -Wno-implicit-int +# temporarily turn off suggesting parenthesis around assignment used as truth value +WARNINGS += -Wno-parentheses + CC=ia16-elf-gcc AS=ia16-elf-as LD=ia16-elf-gcc @@ -96,13 +79,15 @@ TINYPRINTF=$(ELKSCMD_DIR)/lib/tiny_vfprintf.o # # Standard compilation rules. +.PHONY: all clean install + .S.s: $(CC) -E -traditional $(INCLUDES) $(CCDEFS) -o $*.s $< .S.o: $(CC) -E -traditional $(INCLUDES) $(CCDEFS) -o $*.tmp $< $(AS) $(ASFLAGS) -o $*.o $*.tmp - rm -f $*.tmp + $(RM) $*.tmp .s.o: $(AS) $(ASFLAGS) -o $*.o $< diff --git a/elkscmd/advent/Makefile b/elkscmd/advent/Makefile index f4cd96965..689d9634e 100644 --- a/elkscmd/advent/Makefile +++ b/elkscmd/advent/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules CFLAGS += -DELKS=1 #CFLAGS += -Wno-parentheses @@ -43,4 +39,4 @@ install: $(PRGS) $(INSTALL) advent.db $(DESTDIR)/lib clean: - rm -f $(PRGS) $(HOSTPRGS) *.o *.map + $(RM) $(PRGS) $(HOSTPRGS) *.o *.map diff --git a/elkscmd/ash/Makefile b/elkscmd/ash/Makefile index ec749bb2d..52ab8d605 100644 --- a/elkscmd/ash/Makefile +++ b/elkscmd/ash/Makefile @@ -5,16 +5,12 @@ BASEDIR = .. -include $(BASEDIR)/Make.defs - -LOCALFLAGS = -DSHELL -I. -D_MINIX -D_POSIX_SOURCE -Dlint -LOCALFLAGS += -Wno-implicit-int +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = -DSHELL -I. -D_MINIX -D_POSIX_SOURCE -Dlint +LOCALFLAGS += -Wno-implicit-int ############################################################################### @@ -57,7 +53,7 @@ install: ash $(INSTALL) ash $(DESTDIR)/bin/sh clean: - rm -f core ash $(CLEANFILES) + $(RM) ash $(CLEANFILES) parser.o: token.def diff --git a/elkscmd/basic/Makefile b/elkscmd/basic/Makefile index 02a0a06f4..d6d59fc4b 100644 --- a/elkscmd/basic/Makefile +++ b/elkscmd/basic/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules CFLAGS += -Wno-maybe-uninitialized @@ -55,4 +51,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) $(HOSTPRGS) *.o *.map + $(RM) $(PRGS) $(HOSTPRGS) *.o *.map diff --git a/elkscmd/bc/Makefile b/elkscmd/bc/Makefile index 1090122e9..b0669c339 100644 --- a/elkscmd/bc/Makefile +++ b/elkscmd/bc/Makefile @@ -2,13 +2,9 @@ # # A makefile for bc. This is part of the bc/sbc distribution. # -# $Id$ -############################################################################### -# -# Include standard packaging commands. BASEDIR = .. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### # @@ -52,7 +48,7 @@ math.h: libmath.b $(MAKE) -$(MAKEFLAGS) fbc elksemu ./fbc -c libmath.b math.h ./fix_math.h - rm -f ./fbc + $(RM) ./fbc fbc: $(OFILES) bc.o echo \"\" > math.h @@ -64,7 +60,7 @@ install: bc fbc # $(INSTALL) fbc $(DESTDIR)/bin clean: - rm -f *.o *.bak core math.h bc fbc sbc bc.c sbc.c scan.c y.tab.h + $(RM) *.o *.bak math.h bc fbc sbc bc.c sbc.c scan.c y.tab.h scan.c: scan.l $(LEX) scan.l diff --git a/elkscmd/busyelks/makefile b/elkscmd/busyelks/makefile index 2badefb0b..eb4364a99 100644 --- a/elkscmd/busyelks/makefile +++ b/elkscmd/busyelks/makefile @@ -1,6 +1,5 @@ BASEDIR = .. -include $(BASEDIR)/Make.defs -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules # Install destination DESTDIR=$(TOPDIR)/target diff --git a/elkscmd/cron/Makefile b/elkscmd/cron/Makefile index 1f93db851..d026c64dc 100644 --- a/elkscmd/cron/Makefile +++ b/elkscmd/cron/Makefile @@ -1,18 +1,12 @@ -################################################################################## - # Makefile for cron BASEDIR=.. -include $(BASEDIR)/Make.defs - -LOCALFLAGS = -Wno-implicit-int -Wno-return-type $(OPTIONS) +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = -Wno-implicit-int -Wno-return-type $(OPTIONS) ############################################################################### @@ -31,7 +25,7 @@ crontab: crontab.o $(common) $(CC) $(CFLAGS) -maout-heap=14336 -o $@ crontab.o $(common) clean: - rm -f $(progs) *.o + $(RM) $(progs) *.o install: cron $(INSTALL) cron $(DESTDIR)/bin/cron diff --git a/elkscmd/debug/Makefile b/elkscmd/debug/Makefile index bbe47edb4..b997d81db 100644 --- a/elkscmd/debug/Makefile +++ b/elkscmd/debug/Makefile @@ -1,16 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules - -############################################################################### - -PRGS = testsym disasm nm opcodes # disable tail call optimization for better stack traces CFLAGS += -fno-optimize-sibling-calls @@ -24,6 +16,10 @@ LDFLAGS += -maout-symtab # added after CFLAGS for non-instrumented .c files in this directory #NOINSTFLAGS = -fno-instrument-functions -fno-instrument-functions-simple +############################################################################### + +PRGS = testsym disasm nm opcodes + HOSTPRGS = nm86 hostdisasm HOSTCFLAGS += -I. -I$(TOPDIR)/elks/include SYMS_C = $(TOPDIR)/libc/debug/syms.c @@ -68,4 +64,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) $(HOSTPRGS) *.o *.map system.sym + $(RM) $(PRGS) $(HOSTPRGS) *.o *.map system.sym diff --git a/elkscmd/disk_utils/Makefile b/elkscmd/disk_utils/Makefile index 975c25cff..83806903a 100644 --- a/elkscmd/disk_utils/Makefile +++ b/elkscmd/disk_utils/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -39,4 +35,4 @@ ramdisk: ramdisk.o $(LD) $(LDFLAGS) -o ramdisk ramdisk.o $(LDLIBS) clean: - rm -f *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/elvis/Makefile b/elkscmd/elvis/Makefile index 66dbefe9c..dc6a6e770 100644 --- a/elkscmd/elvis/Makefile +++ b/elkscmd/elvis/Makefile @@ -1,10 +1,10 @@ # combined Makefile for ELVIS - a clone of `vi` # -############################################################################### BASEDIR = .. +include $(BASEDIR)/Makefile-rules -include $(BASEDIR)/Make.defs +############################################################################### LOCALFLAGS=-DM_SYSV -DCRUNCH -DNO_MKEXRC -DNO_CURSORSHAPE -DNO_CHARATTR \ -DNO_SHOWMODE -DNO_MODELINE -DNO_OPTCOLS -DNO_DIGRAPH -DNO_ABBR \ @@ -377,7 +377,7 @@ inst.os9: $(DUMMY) ############################################################################## clean: $(DUMMY) - $(RM) *.o $(DOC)*.1 elvis?.uue elvis?.sh core elvis ctags ref virec refont + $(RM) *.o $(DOC)*.1 elvis?.uue elvis?.sh elvis ctags ref virec refont clobber: clean diff --git a/elkscmd/file_utils/Makefile b/elkscmd/file_utils/Makefile index daf3dd610..c4b3f45fe 100644 --- a/elkscmd/file_utils/Makefile +++ b/elkscmd/file_utils/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -87,4 +83,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) *.o + $(RM) $(PRGS) *.o diff --git a/elkscmd/fsck_dos/Makefile b/elkscmd/fsck_dos/Makefile index 6e4e88bcd..f4ca68294 100644 --- a/elkscmd/fsck_dos/Makefile +++ b/elkscmd/fsck_dos/Makefile @@ -1,12 +1,6 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs - -############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules ############################################################################### @@ -14,6 +8,8 @@ LOCALCFLAGS = -Dlint -DELKS=1 # remove next line when FAT32 supported LOCALCFLAGS += -Wno-shift-count-overflow +############################################################################### + PRGS = fsck-dos all: $(PRGS) @@ -40,4 +36,4 @@ fsck-dos: main.o boot.o check.o dir.o fat.o $(LD) $(LDFLAGS) -maout-heap=0xffff -o $@ $^ $(LDLIBS) clean: - rm -f *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/inet/Makefile b/elkscmd/inet/Makefile index 78ae07fd0..4a74fb734 100644 --- a/elkscmd/inet/Makefile +++ b/elkscmd/inet/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### diff --git a/elkscmd/inet/ftp/Makefile b/elkscmd/inet/ftp/Makefile index b1d3b517f..5a97a1146 100644 --- a/elkscmd/inet/ftp/Makefile +++ b/elkscmd/inet/ftp/Makefile @@ -2,13 +2,9 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -28,5 +24,5 @@ install: ftpd ftp $(INSTALL) $(BINS) $(DESTDIR)/bin clean: - rm -f $(BINS) $(OBJS) + $(RM) $(BINS) $(OBJS) diff --git a/elkscmd/inet/httpd/Makefile b/elkscmd/inet/httpd/Makefile index cb2acf4b5..02b990702 100644 --- a/elkscmd/inet/httpd/Makefile +++ b/elkscmd/inet/httpd/Makefile @@ -1,20 +1,16 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS=-I$(ELKSCMD_DIR) +LDFLAGS += -maout-heap=1024 -maout-stack=1024 ############################################################################### PRG=httpd -LOCALFLAGS=-I$(ELKSCMD_DIR) -LDFLAGS += -maout-heap=1024 -maout-stack=1024 - all: $(PRG) $(PRG): httpd.o $(TINYPRINTF) @@ -26,4 +22,4 @@ install: $(PRG) $(INSTALL) sample_index.html $(DESTDIR)/var/www/index.html clean: - rm -f *.o $(PRG) + $(RM) *.o $(PRG) diff --git a/elkscmd/inet/nettools/Makefile b/elkscmd/inet/nettools/Makefile index 888ce805f..f82fb0308 100644 --- a/elkscmd/inet/nettools/Makefile +++ b/elkscmd/inet/nettools/Makefile @@ -1,19 +1,15 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS=-I$(ELKSCMD_DIR) ############################################################################### PRGS=netstat nslookup arp -LOCALFLAGS=-I$(ELKSCMD_DIR) - all: $(PRGS) install: $(PRGS) @@ -30,4 +26,4 @@ arp: arp.o $(TINYPRINTF) $(LD) $(LDFLAGS) arp.o $(TINYPRINTF) -o arp $(LDLIBS) clean: - rm -f core *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/inet/telnet/Makefile b/elkscmd/inet/telnet/Makefile index b71c83d9d..ed8d48167 100644 --- a/elkscmd/inet/telnet/Makefile +++ b/elkscmd/inet/telnet/Makefile @@ -2,13 +2,9 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -24,4 +20,4 @@ install: telnet $(INSTALL) telnet $(DESTDIR)/bin clean: - rm -f $(OBJS) telnet + $(RM) $(OBJS) telnet diff --git a/elkscmd/inet/telnetd/Makefile b/elkscmd/inet/telnetd/Makefile index 606823727..81566d342 100644 --- a/elkscmd/inet/telnetd/Makefile +++ b/elkscmd/inet/telnetd/Makefile @@ -2,13 +2,9 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -25,5 +21,5 @@ install: telnetd $(INSTALL) telnetd $(DESTDIR)/bin clean: - rm -f $(OBJS) telnetd + $(RM) $(OBJS) telnetd diff --git a/elkscmd/inet/tinyirc/Makefile b/elkscmd/inet/tinyirc/Makefile index 3d91e6438..909bf2408 100644 --- a/elkscmd/inet/tinyirc/Makefile +++ b/elkscmd/inet/tinyirc/Makefile @@ -2,13 +2,7 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs - -############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules ############################################################################### @@ -17,6 +11,8 @@ include $(BASEDIR)/Make.rules SERVER = 162.213.39.42 PORT = 8000 +############################################################################### + all: tinyirc LOCALFLAGS = -DPOSIX -DELKS -DDEFAULTSERVER=\"$(SERVER)\" -DDEFAULTPORT=$(PORT) @@ -31,4 +27,4 @@ install: tinyirc $(INSTALL) tinyirc $(DESTDIR)/bin clean: - rm -f *.o tinyirc + $(RM) *.o tinyirc diff --git a/elkscmd/inet/urlget/Makefile b/elkscmd/inet/urlget/Makefile index 7d2e5e9dd..61519148c 100644 --- a/elkscmd/inet/urlget/Makefile +++ b/elkscmd/inet/urlget/Makefile @@ -2,13 +2,9 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -24,5 +20,5 @@ install: urlget $(INSTALL) urlget $(DESTDIR)/bin clean: - rm -f urlget *.o + $(RM) urlget *.o diff --git a/elkscmd/ktcp/Makefile b/elkscmd/ktcp/Makefile index 7b9b76c96..b37da6d95 100644 --- a/elkscmd/ktcp/Makefile +++ b/elkscmd/ktcp/Makefile @@ -1,15 +1,18 @@ # Makefile for ktcp BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules + +############################################################################## SHELL = /bin/sh +############################################################################## + CFILES = ktcp.c slip.c ip.c icmp.c tcp.c tcp_cb.c tcp_output.c \ timer.c tcpdev.c netconf.c vjhc.c deveth.c arp.c hexdump.c OBJS = $(CFILES:.c=.o) -############################################################################## all: ktcp @@ -20,11 +23,7 @@ install: ktcp $(INSTALL) ktcp $(DESTDIR)/bin clean: - rm -f *~ *.o ktcp core + $(RM) *.o ktcp dep: makedepend $(CFILES) - -####### -# EOF # -####### diff --git a/elkscmd/levee/Makefile b/elkscmd/levee/Makefile index df6e1ab3e..19e545f53 100644 --- a/elkscmd/levee/Makefile +++ b/elkscmd/levee/Makefile @@ -2,18 +2,14 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS=-DSIZE=16000L ############################################################################### -LOCALFLAGS=-DSIZE=16000L - OBJS = blockio.o display.o editcor.o exec.o find.o \ unixcall.o globals.o insert.o main.o misc.o \ modify.o move.o ucsd.o undo.o wildargs.o @@ -27,7 +23,7 @@ install: lev $(INSTALL) lev $(DESTDIR)/bin/vi clean: - rm -f *.o lev + $(RM) *.o lev # Dependencies diff --git a/elkscmd/lib/Makefile b/elkscmd/lib/Makefile index 7ecfa1460..03bae635b 100644 --- a/elkscmd/lib/Makefile +++ b/elkscmd/lib/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -19,4 +15,4 @@ CFLAGS += -fno-instrument-functions -fno-instrument-functions-simple all: $(OBJS) clean: - rm -f *.o + $(RM) *.o diff --git a/elkscmd/minix1/Makefile b/elkscmd/minix1/Makefile index 2faee8229..04a512bf2 100644 --- a/elkscmd/minix1/Makefile +++ b/elkscmd/minix1/Makefile @@ -1,17 +1,13 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS=-D_POSIX_SOURCE ############################################################################### -LOCALFLAGS=-D_POSIX_SOURCE - PRGS = banner decomp16 fgrep grep proto sum uniq wc cksum cut du all: $(PRGS) @@ -54,4 +50,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) *.o + $(RM) $(PRGS) *.o diff --git a/elkscmd/minix2/Makefile b/elkscmd/minix2/Makefile index 8436dbca4..8c4cd2f1d 100644 --- a/elkscmd/minix2/Makefile +++ b/elkscmd/minix2/Makefile @@ -1,14 +1,10 @@ BASEDIR=.. -LOCALFLAGS=-D_POSIX_SOURCE - -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS=-D_POSIX_SOURCE ############################################################################### @@ -47,4 +43,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f core *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/minix3/Makefile b/elkscmd/minix3/Makefile index 07fcb8ef7..2389c5e92 100644 --- a/elkscmd/minix3/Makefile +++ b/elkscmd/minix3/Makefile @@ -1,22 +1,16 @@ BASEDIR=.. -LOCALFLAGS= - -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS= ############################################################################### PRGS = file head sed sort tail tee cal diff find mail -# -# Rules -# +all: $(PRGS) cal: cal.o $(TINYPRINTF) $(LD) $(LDFLAGS) -o cal cal.o $(TINYPRINTF) $(LDLIBS) @@ -51,14 +45,8 @@ tee: tee.o mail: mail.o $(LD) $(LDFLAGS) -o mail mail.o $(LDLIBS) - -include $(BASEDIR)/Make.rules - -all: $(PRGS) - - install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f core *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/misc_utils/Makefile b/elkscmd/misc_utils/Makefile index 2a2158d35..b73884fbd 100644 --- a/elkscmd/misc_utils/Makefile +++ b/elkscmd/misc_utils/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -71,4 +67,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) $(HOSTPRGS) *~ *.o + $(RM) $(PRGS) $(HOSTPRGS) *~ *.o diff --git a/elkscmd/nano-X/Makefile b/elkscmd/nano-X/Makefile index bc6082b22..3501b110b 100644 --- a/elkscmd/nano-X/Makefile +++ b/elkscmd/nano-X/Makefile @@ -4,7 +4,7 @@ # BASEDIR = .. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules LOCALFLAGS = -DELKS=1 -DUNIX=1 -DDEBUG=1 -I. MATHLIB = @@ -143,9 +143,9 @@ install: $(NANOXDEMOS) $(INSTALL) demos/nxworld.map $(DESTDIR)/lib/nxworld.map clean: - rm -f *.o *.a nano-X core - rm -f drivers/*.o - rm -f bin/* - rm -f nanox/*.o - rm -f engine/*.o - rm -f demos/*.o + $(RM) *.o *.a nano-X + $(RM) drivers/*.o + $(RM) bin/* + $(RM) nanox/*.o + $(RM) engine/*.o + $(RM) demos/*.o diff --git a/elkscmd/nano-X/demos/Makefile b/elkscmd/nano-X/demos/Makefile index 2febd21cc..f1d513849 100644 --- a/elkscmd/nano-X/demos/Makefile +++ b/elkscmd/nano-X/demos/Makefile @@ -10,7 +10,7 @@ install: $(PROGS) cd $(BINDIR); strip $(PROGS); chmod 755 $(PROGS) clean: - rm -f $(PROGS) *.o core + $(RM) $(PROGS) *.o demo: demo.c $(CC) $(CFLAGS) -o demo demo.c $(LDFLAGS) diff --git a/elkscmd/nano/Makefile b/elkscmd/nano/Makefile index 316580043..320e332d2 100644 --- a/elkscmd/nano/Makefile +++ b/elkscmd/nano/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### diff --git a/elkscmd/nano/ncurses-5.2/ncurses/Makefile b/elkscmd/nano/ncurses-5.2/ncurses/Makefile index 556ca44fa..dcee96588 100644 --- a/elkscmd/nano/ncurses-5.2/ncurses/Makefile +++ b/elkscmd/nano/ncurses-5.2/ncurses/Makefile @@ -80,7 +80,7 @@ LN_S = ln -s #CFLAGS = -O3 #RANLIB = ranlib -include ../../Make.defs +include ../../Makefile-rules CFLAGS += -fno-inline INCDIR = $(srcdir)/../include diff --git a/elkscmd/romprg/Makefile b/elkscmd/romprg/Makefile index fcf189ac2..8a286d346 100644 --- a/elkscmd/romprg/Makefile +++ b/elkscmd/romprg/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules CFLAGS += -Wno-maybe-uninitialized @@ -33,7 +29,7 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) $(HOSTPRGS) *.o *.map + $(RM) $(PRGS) $(HOSTPRGS) *.o *.map diff --git a/elkscmd/sash/Makefile b/elkscmd/sash/Makefile index 21283700b..41f1efac7 100644 --- a/elkscmd/sash/Makefile +++ b/elkscmd/sash/Makefile @@ -2,15 +2,11 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs - -LOCALFLAGS = -Wno-implicit-int +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = -Wno-implicit-int ############################################################################### @@ -23,7 +19,7 @@ sash: $(OBJS) $(LD) $(LDFLAGS) -o sash $(OBJS) $(LDLIBS) clean: - rm -f core sash $(OBJS) + $(RM) sash $(OBJS) install: sash ifdef CONFIG_APP_ASH diff --git a/elkscmd/screen/Makefile b/elkscmd/screen/Makefile index d3a5af66f..71636a8de 100644 --- a/elkscmd/screen/Makefile +++ b/elkscmd/screen/Makefile @@ -24,7 +24,9 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules + +############################################################################### OPTIONS = -DELKS # -DUSEBCOPY # -DLOADAV -DSUNLOADAV -DGETTTYENT -DUSEBCOPY @@ -37,13 +39,6 @@ LOCALFLAGS = -Wno-implicit-int \ LOCALFLAGS += -maout-heap=0x7000 - -############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules - ############################################################################### all: screen @@ -58,7 +53,7 @@ ansi.o: ansi.c screen.h $(CC) $(CFLAGS) -c ansi.c clean: - rm -f screen *.o core *~ + $(RM) screen *.o install: screen $(INSTALL) screen $(DESTDIR)/bin/screen diff --git a/elkscmd/sh_utils/Makefile b/elkscmd/sh_utils/Makefile index a75588c5a..3f98860ed 100644 --- a/elkscmd/sh_utils/Makefile +++ b/elkscmd/sh_utils/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -80,4 +76,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/sys_utils/Makefile b/elkscmd/sys_utils/Makefile index 8ec593c2c..1656dce65 100644 --- a/elkscmd/sys_utils/Makefile +++ b/elkscmd/sys_utils/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -137,4 +133,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f *.o core $(PRGS) $(HOSTPRGS) + $(RM) *.o $(PRGS) $(HOSTPRGS) diff --git a/elkscmd/test/Makefile b/elkscmd/test/Makefile index f3855c60c..b37699b59 100644 --- a/elkscmd/test/Makefile +++ b/elkscmd/test/Makefile @@ -1,4 +1,6 @@ -.PHONY: all clean +BASEDIR=.. + +include $(BASEDIR)/Makefile-rules SUBDIRS = \ libc \ diff --git a/elkscmd/test/cgatext/makefile b/elkscmd/test/cgatext/makefile index efd382546..6f5ffee7f 100644 --- a/elkscmd/test/cgatext/makefile +++ b/elkscmd/test/cgatext/makefile @@ -1,7 +1,6 @@ ELKS = ../.. BASEDIR = ../ -include $(BASEDIR)/Make.defs -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules # Install destination DESTDIR = $(TOPDIR)/target diff --git a/elkscmd/test/echo/Makefile b/elkscmd/test/echo/Makefile index ba8a42518..103256c2b 100644 --- a/elkscmd/test/echo/Makefile +++ b/elkscmd/test/echo/Makefile @@ -1,12 +1,8 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -24,4 +20,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f *.o $(PRGS) + $(RM) *.o $(PRGS) diff --git a/elkscmd/test/libc/Makefile b/elkscmd/test/libc/Makefile index 61264e3f7..711239552 100644 --- a/elkscmd/test/libc/Makefile +++ b/elkscmd/test/libc/Makefile @@ -2,7 +2,7 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules PGM = test_libc @@ -22,8 +22,6 @@ SRCS = \ OBJS = $(SRCS:.c=.o) -include $(BASEDIR)/Make.rules - all: $(PGM) $(PGM): $(OBJS) @@ -33,4 +31,4 @@ install: $(PGM) $(INSTALL) $(PGM) $(DESTDIR)/bin clean: - rm -f $(OBJS) $(PGM) + $(RM) $(OBJS) $(PGM) diff --git a/elkscmd/test/other/Makefile b/elkscmd/test/other/Makefile index 97ad49c2e..9cb40a128 100644 --- a/elkscmd/test/other/Makefile +++ b/elkscmd/test/other/Makefile @@ -1,12 +1,8 @@ BASEDIR=../.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules KERNEL_LIBS = $(TOPDIR)/elks/arch/i86/lib/lib86.a @@ -53,4 +49,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) *.o + $(RM) $(PRGS) *.o diff --git a/elkscmd/tui/Makefile b/elkscmd/tui/Makefile index 68d4ffcaa..de6a2b099 100644 --- a/elkscmd/tui/Makefile +++ b/elkscmd/tui/Makefile @@ -1,12 +1,10 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +CFLAGS += -DELKS=1 ############################################################################### @@ -14,7 +12,6 @@ PRGS = fm matrix cons ttyinfo sl ttyclock ttypong ttytetris #PRGS_HOST = -CFLAGS += -DELKS=1 TUILIB = tty.o runes.o unikey.o all: $(PRGS) $(PRGS_HOST) @@ -47,4 +44,4 @@ install: $(PRGS) $(INSTALL) $(PRGS) $(DESTDIR)/bin clean: - rm -f $(PRGS) $(PRGS_HOST) *~ *.o + $(RM) $(PRGS) $(PRGS_HOST) *.o diff --git a/elkscmd/tui/unikey.c b/elkscmd/tui/unikey.c index ee38e456b..2abde24b2 100644 --- a/elkscmd/tui/unikey.c +++ b/elkscmd/tui/unikey.c @@ -295,7 +295,7 @@ int stream_to_rune(unsigned int ch) * "\e\001" ESC CTRL-ALFA * "\eOP" PF1 * "\000" NUL - * "\e]rm -rf /\e\\" OSC + * "\e]ls -lR /\e\\" OSC * "\302\233A" UP * "\300\200" NUL * diff --git a/elkscmd/unused/byacc/Makefile b/elkscmd/unused/byacc/Makefile index 9f2dedc8c..839943f80 100644 --- a/elkscmd/unused/byacc/Makefile +++ b/elkscmd/unused/byacc/Makefile @@ -2,13 +2,11 @@ BASEDIR = .. -include ../Make.defs +include $(BASEDIR)/Make.defs ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = -DNDEBUG -D_POSIX_SOURCE ############################################################################### @@ -16,8 +14,6 @@ BINDIR = /bin HDRS = defs.h -LOCALFLAGS = -DNDEBUG -D_POSIX_SOURCE - LIBS = LINKER = $(CC) @@ -63,7 +59,7 @@ install: $(PROGRAM) $(INSTALL) $(PROGRAM) $(DESTDIR)/bin clean: - rm -f $(OBJS) $(PROGRAM) core + $(RM) $(OBJS) $(PROGRAM) #depend:; @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST) # diff --git a/elkscmd/unused/m4/Makefile b/elkscmd/unused/m4/Makefile index 5d54b20ca..79fdc1646 100644 --- a/elkscmd/unused/m4/Makefile +++ b/elkscmd/unused/m4/Makefile @@ -2,15 +2,11 @@ BASEDIR = .. -include $(BASEDIR)/Make.defs - -LOCALFLAGS = +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = ############################################################################### @@ -34,5 +30,5 @@ test: m4 diff -u test_host_m4.txt test_elks_m4.txt clean: - rm -f core m4 $(CLEANFILES) + $(RM) m4 $(CLEANFILES) diff --git a/elkscmd/unused/mtools/Makefile b/elkscmd/unused/mtools/Makefile index c4fd62178..8b49f151b 100644 --- a/elkscmd/unused/mtools/Makefile +++ b/elkscmd/unused/mtools/Makefile @@ -4,15 +4,11 @@ BASEDIR = .. -include $(BASEDIR)/Make.defs - -LOCALFLAGS = +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. -include $(BASEDIR)/Make.rules +LOCALFLAGS = ############################################################################### @@ -67,7 +63,7 @@ install-man: done clean: - rm -f $(PROGS) *.o + $(RM) $(PROGS) *.o lint: $(LINT) mdir.c getfat.c init.c search.c match.c convdate.c subdir.c \ diff --git a/elkscmd/unused/prems/Makefile b/elkscmd/unused/prems/Makefile index 0920706a5..1974f66f8 100644 --- a/elkscmd/unused/prems/Makefile +++ b/elkscmd/unused/prems/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### diff --git a/elkscmd/unused/prems/prem/Makefile b/elkscmd/unused/prems/prem/Makefile index 6c7dfeb05..6fd6aebd0 100644 --- a/elkscmd/unused/prems/prem/Makefile +++ b/elkscmd/unused/prems/prem/Makefile @@ -1,6 +1,5 @@ BASEDIR = ../.. -include $(BASEDIR)/Make.defs -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules LOCALFLAGS=-I. diff --git a/elkscmd/unused/prems/pres/Makefile b/elkscmd/unused/prems/pres/Makefile index 49106b861..3ae369907 100644 --- a/elkscmd/unused/prems/pres/Makefile +++ b/elkscmd/unused/prems/pres/Makefile @@ -1,6 +1,5 @@ BASEDIR = ../.. -include $(BASEDIR)/Make.defs -include $(BASEDIR)/Make.rules +include $(BASEDIR)/Makefile-rules LOCALFLAGS= -I. -I../prem diff --git a/elkscmd/unused/xvi/Makefile b/elkscmd/unused/xvi/Makefile index 58a8ecb15..c2634a755 100644 --- a/elkscmd/unused/xvi/Makefile +++ b/elkscmd/unused/xvi/Makefile @@ -1,12 +1,8 @@ BASEDIR=.. -include $(BASEDIR)/Make.defs +include $(BASEDIR)/Makefile-rules ############################################################################### -# -# Include standard packaging commands. - -include $(BASEDIR)/Make.rules ############################################################################### @@ -19,4 +15,4 @@ install: xvi $(INSTALL) xvi $(DESTDIR)/bin clean: - rm -f core xvi *.o + $(RM) xvi *.o diff --git a/image/Make.rules b/image/Make.rules deleted file mode 100644 index 61a8f9f33..000000000 --- a/image/Make.rules +++ /dev/null @@ -1,3 +0,0 @@ -# Images common rules - -.PHONY: all clean install