replace Imakefile with a simpler Makefile, similar to x48ng

This commit is contained in:
Gwenhael Le Moine 2024-03-20 20:36:02 +01:00
parent 0f630fede9
commit 13f940b049
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
40 changed files with 57 additions and 526 deletions

38
.gitignore vendored
View file

@ -1,24 +1,20 @@
/Chf/mt_build/ /Chf/mt_build/
/Chf/st_build/ /Chf/st_build/
/Makefile dist/pack
/Makefile.bak dist/saturn
/Saturn
/cpu
/hdw
/mod
/pack
/pack._man
/saturn
/saturn._man
/saturn.cat
/stateDir.gwh_run48/
/stateDir.gwh_run49/
/src/*.o /src/*.o
/saturn.toc docs/saturn.toc
/saturn.aux docs/saturn.aux
/saturn.cp docs/saturn.cp
/saturn.cps docs/saturn.cps
/saturn.dvi docs/saturn.dvi
/saturn.info docs/saturn.info
/saturn.pdf docs/saturn.pdf
/saturn.ps docs/saturn.ps
dist/Saturn
dist/pack
dist/saturn
dist/saturn.cat
dist/stateDir.gwh_run48/
dist/stateDir.gwh_run49/

229
Imakefile
View file

@ -1,229 +0,0 @@
# .+
#
# .identifier : $Id: Imakefile,v 4.1 2000/12/11 09:54:19 cibrario Rel $
# .context : SATURN, Saturn CPU / HP48 emulator
# .title : $RCSfile: Imakefile,v $
# .kind : Makefile
# .author : Ivan Cibrario B.
# .site : CSTV-CNR
# .creation : *
# .keywords : *
# .description :
# Imakefile.
# .notes :
# $Log: Imakefile,v $
# Revision 4.1 2000/12/11 09:54:19 cibrario
# Public release.
#
# Revision 3.16 2000/11/21 16:37:20 cibrario
# Ultrix/IRIX support:
# - Propagate CC and CFLAGS to Chf library as fallback values
# - Added -li library for Ultrix
# - Use RM directly if needed macros are not available
#
# Revision 3.14 2000/11/13 10:24:52 cibrario
# Implemented fast load/save; improved keyboard interface emulation at
# high emulated CPU speed:
#
# - New file disk_io_obj.c
#
# Revision 3.13 2000/11/09 11:14:50 cibrario
# Revised to add file selection box GUI element, CPU halt/run
# requests and emulator's extended functions:
#
# - New files: x_func.h, x_func.c, x_func.msf
#
# Revision 3.9 2000/10/24 16:12:55 cibrario
# Added Texinfo documentation targets
#
# Revision 3.8 2000/10/23 13:18:58 cibrario
# Bug fixes:
# - saturn.cat did not contain Chf messages
# - extended 'clean' target to remove saturn.cat as well
# - CatDestination was wrong on Debian GNU/Linux
#
# Revision 3.6 2000/10/02 13:54:04 cibrario
# ROM handling utilities:
# - Added support for stand-alone build of Chf library in its subdirectory
# - Added build commands for 'pack' utility
#
# Revision 3.5 2000/10/02 09:55:10 cibrario
# Linux support:
# - openpty() is in -lutil
# - message catalog must be installed in /usr/lib/locale/C
#
# Revision 3.3 2000/09/26 15:26:07 cibrario
# Revised to implement Flash ROM write access:
# - Added new files flash49.c and flash49.msf
#
# Revision 3.2 2000/09/22 13:21:33 cibrario
# Implemented preliminary support of HP49 hw architecture:
# - added new modules hw_config.c and romram49.c to SRCS list
#
# Revision 2.5 2000/09/14 15:41:16 cibrario
# Added new files serial.c and serial.msf
#
# Revision 2.1 2000/09/08 15:39:34 cibrario
# Added automatic installation of application default file and
# message catalog; removed platform-dependent options.
#
# Revision 1.1 1998/02/19 12:03:28 cibrario
# Initial revision
#
#
# .-
#
# Stand-alone build of Chf library in its subdirectory
#
# 3.16: Propagate CC and CFLAGS to Chf library as fallback values
#
#define IHaveSubdirs
#define PassCDebugFlags X_CC="$(CC)" X_CFLAGS="$(CFLAGS)"
SUBDIRS = Chf
MakeSubdirs($(SUBDIRS))
#
# Programs built by this Imakefile
#
PROGRAMS= saturn pack
#
# Source/object files
# Each row corresponds to a group of files; each group has its own
# CHF module identifier and message catalog source file.
#
SRCS1= src/debug.c \
src/cpu.c src/dis.c src/emulator.c src/monitor.c \
src/modules.c src/hw_config.c src/romram.c src/romram49.c src/hdw.c src/keyb.c \
src/disk_io.c src/disk_io_obj.c \
src/display.c src/x11.c \
src/serial.c src/flash49.c src/x_func.c\
src/saturn.c
#
# Message catalog source files for the modules defined above.
#
MSFS= debug.msf \
cpu.msf \
modules.msf \
disk_io.msf \
x11.msf \
serial.msf flash49.msf x_func.msf\
saturn.msf util.msf \
Chf/chf.msf
#
# Source/object files of secondary target
#
SRCS2= src/pack.c
#
# Automatic generation of object file list
#
OBJS1= $(SRCS1:.c=.o)
OBJS2= $(SRCS2:.c=.o) src/disk_io.o src/debug.o
#
# Now, some extras... bring the Chf library in.
#
EXTRA_INCLUDES = -I./Chf
EXTRA_LOAD_FLAGS = -L./Chf/st_build
# 3.5: Added linux support; openpty() is in -lutil
#
#if defined(LinuxArchitecture)
EXTRA_ARCH_LIBRARIES = -lutil
#endif
# 3.16: Added Ultrix support; catopen() is in -li
#
#if defined(UltrixArchitecture)
EXTRA_TAIL_LIBRARIES = -li
#endif
EXTRA_LIBRARIES = $(EXTRA_ARCH_LIBRARIES) \
-lXm $(XTOOLLIB) $(XLIB) -lChf \
$(EXTRA_TAIL_LIBRARIES)
#
# Main Target
#
ComplexProgramTarget_1(saturn,NullParameter,NullParameter)
#
# Main Target
#
ComplexProgramTarget_2(pack,NullParameter,NullParameter)
#
# Installation of the application default file; primary target only.
#
InstallAppDefaults(Saturn)
#
# Special message catalog targets
#
saturn.cat: $(MSFS)
for msf in $? ; \
do gencat saturn.cat $$msf ; \
done
all:: saturn.cat
#
# 3.16: Use RM directly if macro is not available
#
#ifdef ImakeConfigRelease
clean::
RemoveFile(saturn.cat)
#else
clean::
$(RM) saturn.cat
#endif
#
# Determine destination of saturn.cat; for now, few architectures are
# supported.
#
#if defined(AlphaArchitecture)
#define CatDestination /usr/lib/nls/msg/C
#elif defined(SunArchitecture)
#define CatDestination /usr/lib/locale/C/LC_MESSAGES
#elif defined(LinuxArchitecture)
#define CatDestination /usr/share/locale/C/LC_MESSAGES
#endif
#if defined(CatDestination)
InstallNonExecFile(saturn.cat,CatDestination)
#else
install::
echo "*** Can't determine CatDestination; install saturn.cat manually"
#endif
#
# TexInfo Documentation
#
MAKEINFO= makeinfo
TEXI2DVI= texi2dvi
DVIPS= dvips
doc:
$(MAKEINFO) saturn.texi
$(TEXI2DVI) saturn.texi && $(DVIPS) -o saturn.ps saturn.dvi
@echo "*** Install saturn.info manually, please"
#
# 3.16: Use RM directly if macro is not available
#
#ifdef ImakeConfigRelease
clean::
RemoveFiles(*.aux *.cp *.cps *.dvi *.fn *.info *.ky *.log *.pg)
RemoveFiles(*.ps *.toc *.tp *.vr)
#else
clean::
$(RM) *.aux *.cp *.cps *.dvi *.fn *.info *.ky *.log *.pg
$(RM) *.ps *.toc *.tp *.vr
#endif

View file

@ -40,23 +40,45 @@ DOTOS = src/cpu.o \
src/x11.o \ src/x11.o \
src/x_func.o src/x_func.o
MSFS= Msfs/debug.msf \
Msfs/cpu.msf \
Msfs/modules.msf \
Msfs/disk_io.msf \
Msfs/x11.msf \
Msfs/serial.msf Msfs/flash49.msf Msfs/x_func.msf\
Msfs/saturn.msf Msfs/util.msf \
Chf/chf.msf
.PHONY: all clean clean-all pretty-code install mrproper .PHONY: all clean clean-all pretty-code install mrproper
all: saturn pack all: Chf/st_build/libChf.a dist/saturn dist/pack dist/saturn.cat docs
# Binaries # Binaries
saturn: $(DOTOS) Chf/st_build/libChf.a:
make -C Chf
dist/saturn: $(DOTOS) Chf/st_build/libChf.a
$(CC) $^ -o $@ $(CFLAGS) $(LIBS) $(CC) $^ -o $@ $(CFLAGS) $(LIBS)
pack: src/pack.o src/disk_io.o src/debug.o dist/pack: src/pack.o src/disk_io.o src/debug.o Chf/st_build/libChf.a
$(CC) $^ -o $@ $(CFLAGS) $(LIBS) $(CC) $^ -o $@ $(CFLAGS) $(LIBS)
dist/saturn.cat: $(MSFS)
for msf in $? ; \
do gencat $@ $$msf ; \
done
docs:
make -C docs
# Cleaning # Cleaning
clean: clean:
rm -f src/*.o rm -f src/*.o
make -C Chf clean
make -C docs clean
mrproper: clean mrproper: clean
rm -f pack saturn rm -f dist/pack dist/saturn dist/saturn.cat
clean-all: mrproper clean-all: mrproper

View file

View file

View file

View file

View file

View file

14
docs/Makefile Normal file
View file

@ -0,0 +1,14 @@
#
# TexInfo Documentation
#
MAKEINFO= makeinfo
TEXI2DVI= texi2dvi
DVIPS= dvips
doc:
$(MAKEINFO) saturn.texi
$(TEXI2DVI) saturn.texi && $(DVIPS) -o saturn.ps saturn.dvi
@echo "*** Install saturn.info manually, please"
clean:
-rm saturn.aux saturn.cp saturn.cps saturn.dvi saturn.info saturn.log saturn.ps saturn.toc

View file

@ -1,78 +0,0 @@
#!/bin/csh
#
# $Id: gpl_replace,v 4.1 2000/12/11 09:54:19 cibrario Rel $
#
# This script adds/replaces the GPL header $gpl_template in
# all .c and .h files in the RCS repository. Must be executed on
# a clean (no locked files) repository.
#
# Arguments:
#
# argv[1]: -r argument to ci
# argv[2]: -m argument to ci, default provided
if( $#argv < 1 ) then
echo "gpl_replace: missing target release number"
exit 1
endif
if( $#argv == 1 ) then
set argv = ($argv "Added/Replaced GPL header")
endif
set gpl_template = gpl_template
set rcs_flist = `ls RCS/*.[ch],v`
set exit_code = 0
co $gpl_template
if( $status != 0 ) then
echo "gpl_replace: co ${gpl_template} failed"
exit 9
endif
foreach rcs_file ($rcs_flist)
set file = `basename $rcs_file ,v`
set s_file = "${file}_s"
set j_file = "${file}_j"
set b_file = "${file}_b"
# Extract file from repository
co -l $file
if( $status != 0 ) then
echo "gpl_replace: ${file}: checkout failed; edit manually"
set exit_code = 2
continue
endif
sed -e '/.*+-+.*/,$\!d' $file > $s_file
if( -z $s_file ) then
# File does not contain the template yet; add
cat $gpl_template - $file > $j_file <<EOF
/* +-+ */
EOF
else
# File did contain an older template; replace
cat $gpl_template - $s_file > $j_file <<EOF
EOF
endif
rm $s_file
mv $file $b_file
mv $j_file $file
ci -r$argv[1] -m"$argv[2]" $file
# Remove backup file only if update was ok
if( $status == 0 ) then
rm $b_file
else
echo "gpl_replace: ${file}: ci failed; backup in ${b_file}"
rcs -u $file
set exit_code = 3
continue
endif
end
exit $exit_code

View file

@ -1,30 +0,0 @@
/* -------------------------------------------------------------------------
saturn - A poor-man's emulator of some HP calculators
Copyright (C) 1998-2000 Ivan Cibrario Bertolotti
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the documentation of this program; if not, write to
the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For more information, please contact the author, preferably by email,
at the following address:
Ivan Cibrario Bertolotti
IRITI - National Research Council
c/o IEN "Galileo Ferraris"
Strada delle Cacce, 91
10135 - Torino (ITALY)
email: cibrario@iriti.cnr.it
------------------------------------------------------------------------- */

View file

@ -1,9 +0,0 @@
#!/bin/bash -eu
xmkmf
make clean
rm src/*.o
make depend
make

View file

@ -1,9 +0,0 @@
#!/bin/sh
#
# $Id: make_dist,v 4.1 2000/12/11 09:54:19 cibrario Rel $
#
# This script builds the RCS distribution tar, saturn_RCS.tar;
# to do this, it first executes a 'make clean'.
make clean
tar cf saturn_RCS.tar RCS/* Chf/*

View file

@ -1,44 +0,0 @@
#!/bin/csh
#
# $Id: make_src_dist,v 4.1 2000/12/11 09:54:19 cibrario Rel $
#
# This script builds the source distribution tar, saturn_src_....tar;
# the source distribution contains a snapshot of the RCS repository
# for release $argv[1]. The name of the source distribution tar
# includes $argv[1] as its last component.
if( $#argv < 1 ) then
echo "make_src_dist: missing target release number"
exit 1
endif
set rel = $argv[1]
set target_tar = saturn_src_$rel.tar
set rcs_flist = (RCS/*,v)
set flist = ""
set exit_code = 0
foreach rcs_file ($rcs_flist)
set file = `basename $rcs_file ,v`
# Extract file from repository
co -r$rel $file
if( $status != 0 ) then
echo "make_src_dist: ${file}: checkout failed for release $rel"
set exit_code = 2
continue
endif
# Add file to file list
set flist = ($flist $file)
end
make clean
tar cf $target_tar $flist Chf/*
if( $status != 0 ) then
echo "make_src_dist: tar failed"
set exit_code = 3
endif
exit $exit_code

View file

@ -1,102 +0,0 @@
#!/bin/csh
#
# $Id: make_ubin_dist,v 4.1 2000/12/11 09:54:19 cibrario Rel $
#
# This script builds a user-level binary distribution for release
# $argv[1]. The name of the binary distribution tar
# includes $argv[1] as its last component.
#
# $argv[2] contains the make Makefile command
if( $#argv < 1 ) then
echo "make_ubin_dist: missing target release number"
exit 1
endif
if( $#argv < 2 ) then
echo "make_ubin_dist: missing make Makefile command"
exit 1
endif
set rel = $argv[1]
set src_tar = saturn_src_$rel.tar
set ubin_tar = saturn_ubin_$rel.tar
set special_flist = (sutil_48.lib sutil_49.lib)
set bin_flist = (README.txt BUILD_INFO.txt saturn Saturn.ad saturn.cat run_saturn quick_start saturn.ps saturn.info pack)
./make_src_dist $rel
if( $status != 0 && $status != 2 ) then
echo "make_ubin_dist: make_src_dist failed"
exit 2
endif
mkdir tmp_ubin; cd tmp_ubin
tar xvf ../$src_tar
if( $status != 0 ) then
echo "make_ubin_dist: source tar extract failed"
exit 3
endif
cat - > BUILD_INFO.txt <<EOF
This is a user-level binary distribution of saturn release $rel.
saturn - A poor-man's emulator of some HP calculators
Copyright (C) 1998-2000 Ivan Cibrario Bertolotti
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the documentation of this program; if not, write to
the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For more information, please contact the author, preferably by email,
at the following address:
Ivan Cibrario Bertolotti
IRITI - National Research Council
c/o IEN "Galileo Ferraris"
Strada delle Cacce, 91
10135 - Torino (ITALY)
email: cibrario@iriti.cnr.it
The distribution was created on:
`date`
The build host was (uname -a):
`uname -a`
EOF
if( $status != 0 ) then
echo "make_ubin_dist: can't create BUILD_INFO.txt"
exit 4
endif
$argv[2]
make depend; make; make doc
# Special: Copy special binaries down
foreach special ($special_flist)
cp ../$special .
end
tar cvf ../$ubin_tar $bin_flist $special_flist
if( $status != 0 ) then
echo "make_ubin_dist: can't create binary tar"
exit 5
endif
cd ..
rm -rf tmp_ubin

View file

View file