Now describe the make-based build system in the README.

--HG--
branch : dtrg-buildsystem
This commit is contained in:
David Given 2013-05-15 23:12:05 +01:00
parent aaa3f14a79
commit 8fbce949f5
4 changed files with 79 additions and 5714 deletions

View file

@ -1,4 +1,36 @@
BUILDDIR = /tmp/obj # ======================================================================= #
# ACK CONFIGURATION #
# (Edit this before building) #
# ======================================================================= #
# What platform to build for by default?
DEFAULT_PLATFORM = pc86
# Where should the ACK put its temporary files?
ACK_TEMP_DIR = /tmp
# Where is the ACK going to be installed, eventually?
PREFIX = /usr/local
# Where do you want to put the object files used when building?
BUILDDIR = $(ACK_TEMP_DIR)/ack-build
# What build flags do you want to use?
CFLAGS = -g
LDFLAGS = -s
# ======================================================================= #
# END OF CONFIGURATION #
# ======================================================================= #
#
# You shouldn't need to change anything below this point unless you are
# actually developing ACK.
OBJDIR = $(BUILDDIR)/obj OBJDIR = $(BUILDDIR)/obj
BINDIR = $(BUILDDIR)/bin BINDIR = $(BUILDDIR)/bin
LIBDIR = $(BUILDDIR)/lib LIBDIR = $(BUILDDIR)/lib
@ -15,13 +47,12 @@ CP = cp
hide = @ hide = @
CFLAGS = \ CFLAGS += \
-g \
-I$(INCDIR) \ -I$(INCDIR) \
-Imodules/h \ -Imodules/h \
-Ih -Ih
LDFLAGS = LDFLAGS +=
all: installables all: installables
@ -81,6 +112,11 @@ include plat/linux68k/build.mk
.PHONY: installables .PHONY: installables
installables: $(INSTALLABLES) installables: $(INSTALLABLES)
.PHONY: install
install: installables
@echo INSTALLING into $(PREFIX)
$(hide) tar cf - -C $(INSDIR) . | tar xvf - -C $(PREFIX)
.PHONY: clean .PHONY: clean
clean: clean:
@echo CLEAN @echo CLEAN
@ -90,15 +126,15 @@ $(INCDIR)/local.h:
@echo LOCAL @echo LOCAL
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) echo '#define VERSION 3' > $@ $(hide) echo '#define VERSION 3' > $@
$(hide) echo '#define ACKM "pc86"' >> $@ $(hide) echo '#define ACKM "$(DEFAULT_PLATFORM)"' >> $@
$(hide) echo '#define BIGMACHINE 1' >> $@ $(hide) echo '#define BIGMACHINE 1' >> $@
$(hide) echo '#define SYS_5' >> $@ $(hide) echo '#define SYS_5' >> $@
$(INCDIR)/em_path.h: $(INCDIR)/em_path.h:
@echo EM_PATH @echo EM_PATH
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) echo '#define TMP_DIR "/tmp"' > $@ $(hide) echo '#define TMP_DIR "$(ACK_TEMP_DIR)"' > $@
$(hide) echo '#define EM_DIR "/tmp/obj/staging"' >> $@ $(hide) echo '#define EM_DIR "$(PREFIX)"' >> $@
$(hide) echo '#define ACK_PATH "share/ack/descr"' >> $@ $(hide) echo '#define ACK_PATH "share/ack/descr"' >> $@
-include $(DEPENDS) -include $(DEPENDS)

72
README
View file

@ -1,8 +1,8 @@
THE AMSTERDAM COMPILER KIT V6.0pre4 THE AMSTERDAM COMPILER KIT V6.0pre5
=================================== ===================================
© 1987-2005 Vrije Universiteit, Amsterdam © 1987-2005 Vrije Universiteit, Amsterdam
2010-08-08 2013-05-15
INTRODUCTION INTRODUCTION
@ -24,59 +24,58 @@ SUPPORT
Languages: Languages:
ANSI C, Pascal, Modula 2. K&R is supported via the ANSI C compiler. ANSI C, Pascal, Modula 2, Basic. K&R is supported via the ANSI C compiler.
Platforms: Platforms:
pc86 produces bootable floppy disk images for 8086 PCs pc86 produces bootable floppy disk images for 8086 PCs
linux386 produces ELF executables for PC Linux systems linux386 produces ELF executables for PC Linux systems
linux68k produces ELF executables for m68020 Linux systems
cpm produces i80 CP/M .COM files cpm produces i80 CP/M .COM files
INSTALLATION INSTALLATION
============ ============
The version 6.0 build mechanism has been completely rewritten and is based The version 5.0 build mechanism has been completely rewritten. Installation
around the Prime Mover build tool (see http://primemover.sf.net for more ought to be fairly straightforward.
information). Installation ought to be fairly straightforward.
Requirements: Requirements:
- an ANSI C compiler. Currently, I'm afraid, it's hard-coded to use gcc. - an ANSI C compiler. This defaults to gcc. You can change this by setting
To change, try changing the variable definitions in first/c.pm. This also the CC make variable.
needs to be available as 'cc' from the shell.
- about 40MB free in /tmp (or some other temporary directory).
- about 20MB free in /tmp (or some other temporary directory).
- about 6MB in the target directory. - about 6MB in the target directory.
Instructions: Instructions:
- edit config.pm. There's a small section at the top containing some editable - edit the Makefile. There's a small section at the top where you can change
variables. Probably the only one you may want to edit is PREFIX, which the configuration. Probably the only one you may want to edit is PREFIX,
changes where the ACK installs to. which changes where the ACK installs to.
- Run: - Run:
./pm configure make
...from the command line. This will write out a configuration file. ...from the command line. This will do the build.
The make system is fully parallelisable. If you have a multicore system,
you probably want to do:
make -j8
...instead (substituting the right number of cores, of course). You can
also shave a few seconds of the build time by using the -r flag.
- Run: - Run:
./pm sudo make install
...from the command line. This will actually do the build. This takes ...from the command line. This will install the ACK in your PREFIX
about two minutes on my 1.6GHz Athlon Linux machine and about 30 on my directory (by default, /usr/local).
166MHz Pentium OpenBSD machine.
- Run:
./pm install
...from the command line (possibly with sudo). This will install the built
ACK into whatever directory you nominated in PREFIX.
The ACK should now be ready to use. The ACK should now be ready to use.
@ -94,8 +93,9 @@ Some useful options include:
-o <file> specifies the output file -o <file> specifies the output file
-c produce a .o file -c produce a .o file
-c.s produce a .s assembly file -c.s produce a .s assembly file
-O enable optimisation -O enable optimisation (optimisation levels go up to 6)
-ansi compile ANSI C (when using the C compiler) -ansi compile ANSI C (when using the C compiler)
-v be more verbose (repeatable)
<file> build file <file> build file
ack figures out which language to use from the file extension: ack figures out which language to use from the file extension:
@ -107,6 +107,7 @@ ack figures out which language to use from the file extension:
.p Pascal .p Pascal
.o object files .o object files
.s assembly files .s assembly files
.e ACK intermediate code assembly files
For further information, see the man page (which actually does get For further information, see the man page (which actually does get
installed, but is rather out of date). installed, but is rather out of date).
@ -117,6 +118,7 @@ A sample command line is:
ack -mlinux386 -O examples/paranoia.c ack -mlinux386 -O examples/paranoia.c
GOTCHAS GOTCHAS
======= =======
@ -163,8 +165,4 @@ Please enjoy.
David Given (dtrg on Sourceforge) David Given (dtrg on Sourceforge)
dg@cowlark.com dg@cowlark.com
2010-08-08 2013-05-13
# $Source$
# $State$
# $Revision$

View file

@ -23,7 +23,7 @@ $(call cfile, mach/proto/ncg/subr.c)
$(call cfile, mach/proto/ncg/var.c) $(call cfile, mach/proto/ncg/var.c)
$(eval $q: $(OBJDIR)/$D/tables.h) $(eval $q: $(OBJDIR)/$D/tables.h)
$(eval CLEANABLES += $(OBJDIR)/$D/tables.h $(OBJDIR)/$D/table.c) $(eval CLEANABLES += $(OBJDIR)/$D/tables.h $(OBJDIR)/$D/tables.c)
$(OBJDIR)/$D/tables.c: $(OBJDIR)/$D/tables.h $(OBJDIR)/$D/tables.c: $(OBJDIR)/$D/tables.h
$(OBJDIR)/$D/tables.h: $(NCGG) $(CPPANSI) mach/$(ARCH)/ncg/table $(OBJDIR)/$D/tables.h: $(NCGG) $(CPPANSI) mach/$(ARCH)/ncg/table
@echo NCGG $$@ @echo NCGG $$@

5669
pm

File diff suppressed because it is too large Load diff