make(1): clean up Makefile.boot

The previous version stopped working in 2015, when metachar.c was added.
Since then, lst.c and enum.c have been added, and the lst.lib directory
has gone.

To build bmake on Cygwin, some extra CFLAGS are necessary for some of
the files.  Compilation succeeded by first building the majority of
files with "bmake -f Makefile.boot EXTRA_CFLAGS=-DMAKE_NATIVE", and the
remaining files with "-UMAKE_NATIVE".

Reorganize the file structure to put the most likely configuration into
the top paragraph, with all variable values nicely aligned.
This commit is contained in:
rillig 2020-08-09 15:54:13 +00:00
parent 588fbd37da
commit f2b2aa8be0
1 changed files with 24 additions and 30 deletions

View File

@ -1,45 +1,39 @@
# $NetBSD: Makefile.boot,v 1.21 2014/02/24 07:23:44 skrll Exp $
# $NetBSD: Makefile.boot,v 1.22 2020/08/09 15:54:13 rillig Exp $
#
# a very simple makefile...
# A very simple makefile...
#
# You only want to use this if you aren't running NetBSD.
#
# modify MACHINE and MACHINE_ARCH as appropriate for your target architecture
# Modify MACHINE and MACHINE_ARCH as appropriate for your target architecture.
# See config.h and the various #ifdef directives for further configuration.
#
CC=gcc -O -g
PROG= bmake
MACHINE= i386
MACHINE_ARCH= i386
CC= gcc
CFLAGS= -O -g
EXTRA_CFLAGS=
EXTRA_LIBS=
OBJS= arch.o buf.o compat.o cond.o dir.o enum.o for.o hash.o \
job.o lst.o main.o make.o make_malloc.o metachar.o parse.o \
str.o strlist.o suff.o targ.o trace.o var.o util.o
.c.o:
${CC} ${CFLAGS} -c $< -o $@
${CC} ${CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} -c $< -o $@
MACHINE=i386
MACHINE_ARCH=i386
# tested on HP-UX 10.20
#MAKE_MACHINE=hppa
#MAKE_MACHINE_ARCH=hppa
CFLAGS= -DTARGET_MACHINE=\"${MACHINE}\" \
CPPFLAGS= \
-DTARGET_MACHINE=\"${MACHINE}\" \
-DTARGET_MACHINE_ARCH=\"${MACHINE_ARCH}\" \
-DMAKE_MACHINE=\"${MACHINE}\"
LIBS=
OBJ=arch.o buf.o compat.o cond.o dir.o for.o hash.o job.o main.o make.o \
make_malloc.o parse.o str.o strlist.o suff.o targ.o trace.o var.o util.o
LIBOBJ= lst.lib/lstAppend.o lst.lib/lstAtEnd.o lst.lib/lstAtFront.o \
lst.lib/lstClose.o lst.lib/lstConcat.o lst.lib/lstDatum.o \
lst.lib/lstDeQueue.o lst.lib/lstDestroy.o lst.lib/lstDupl.o \
lst.lib/lstEnQueue.o lst.lib/lstFind.o lst.lib/lstFindFrom.o \
lst.lib/lstFirst.o lst.lib/lstForEach.o lst.lib/lstForEachFrom.o \
lst.lib/lstInit.o lst.lib/lstInsert.o lst.lib/lstIsAtEnd.o \
lst.lib/lstIsEmpty.o lst.lib/lstLast.o lst.lib/lstMember.o \
lst.lib/lstNext.o lst.lib/lstOpen.o lst.lib/lstRemove.o \
lst.lib/lstReplace.o lst.lib/lstSucc.o lst.lib/lstPrev.o
bmake: ${OBJ} ${LIBOBJ}
# @echo 'make of make and make.0 started.'
${CC} ${CFLAGS} ${OBJ} ${LIBOBJ} -o bmake ${LIBS}
${PROG}: ${OBJS}
# @echo 'make of ${PROG} and make.0 started.'
${CC} ${CFLAGS} ${OBJS} -o $@ ${EXTRA_LIBS}
@ls -l $@
# nroff -h -man make.1 > make.0
# @echo 'make of make and make.0 completed.'
# @echo 'make of ${PROG} and make.0 completed.'
clean:
rm -f ${OBJ} ${LIBOBJ} ${PORTOBJ} bmake
rm -f ${OBJS} ${PROG}