Swap make and tar.

This commit is contained in:
Andrius Štikonas 2022-05-14 12:42:03 +01:00
parent b9079045db
commit e4f5342ee4
6 changed files with 55 additions and 59 deletions

View File

@ -97,13 +97,6 @@ gzip 1.2.4
code. It is luckily distributed as a barebones uncompressed ``.tar``,
which we extract and then build.
Going forward, we can now use ``.tar.gz`` for source code.
tar 1.12
========
We build GNU Tar 1.12, the last version compilable with mes libc.
make 3.80
=========
@ -111,6 +104,11 @@ GNU ``make`` is now built so we have a more robust building system.
``make`` allows us to do things like define rules for files rather than
writing complex kaem scripts.
tar 1.12
========
We build GNU Tar 1.12, the last version compilable with mes libc.
sed 4.0.9
=========

View File

@ -102,12 +102,12 @@ class SysA(SysGeneral):
# gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar.gz")
# tar 1.12
self.get_file("https://mirrors.kernel.org/gnu/tar/tar-1.12.tar.gz")
# make 3.80
self.get_file("https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz")
# tar 1.12
self.get_file("https://mirrors.kernel.org/gnu/tar/tar-1.12.tar.gz")
# sed 4.0.9
self.get_file("https://mirrors.kernel.org/gnu/sed/sed-4.0.9.tar.gz")

View File

@ -82,14 +82,14 @@ cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# tar
pkg="tar-1.12"
# make
pkg="make-3.80"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# make
pkg="make-3.80"
# tar
pkg="tar-1.12"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..

View File

@ -12,7 +12,7 @@ cd build
# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
gunzip -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
untar ../src/${pkg}.tar
cd ${pkg}
# Create .h files

36
sysa/tar-1.12/mk/main.mk Normal file
View File

@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
CC = tcc
AR = tcc -ar
# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic
# This is to avoid running configure test to determine sizeof(long long)
CPPFLAGS = -DHAVE_FCNTL_H \
-DHAVE_DIRENT_H \
-DHAVE_GETCWD_H \
-DHAVE_GETCWD \
-DSIZEOF_UNSIGNED_LONG=4 \
-DVERSION=\"1.12\" \
-DPACKAGE=\"tar\"
CFLAGS = -I . -I lib -static
LDFLAGS = -L. -ltar
.PHONY: all
LIB_SRC = argmatch backupfile error fnmatch ftruncate getdate_stub getopt getopt1 getversion modechange msleep xgetcwd xmalloc xstrdup
LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC)))
TAR_SRC = arith buffer compare create delete extract incremen list mangle misc names open3 rtapelib tar update
TAR_OBJ = $(addprefix src/, $(addsuffix .o, $(TAR_SRC)))
all: tar
libtar.a: $(LIB_OBJ)
$(AR) cr $@ $^
tar: libtar.a $(TAR_OBJ)
$(CC) $^ $(LDFLAGS) -o $@

View File

@ -17,55 +17,17 @@ gunzip -f ../src/${pkg}.tar.gz
untar ../src/${pkg}.tar
cd ${pkg}
cp ../../mk/main.mk Makefile
cp ../../files/getdate_stub.c lib/getdate_stub.c
catm src/create.c.new ../../files/stat_override.c src/create.c
cp src/create.c.new src/create.c
# Compile
# Build
make -f Makefile
## libtar.a
cd lib
tcc -c argmatch.c
tcc -c -DHAVE_DIRENT_H backupfile.c
tcc -c -I . error.c
tcc -c -I . fnmatch.c
tcc -c ftruncate.c
tcc -c getdate_stub.c
tcc -c getopt.c
tcc -c getopt1.c
tcc -c getversion.c
tcc -c modechange.c
tcc -c msleep.c
tcc -c -DHAVE_GETCWD xgetcwd.c
tcc -c xmalloc.c
tcc -c xstrdup.c
tcc -ar cr libtar.a argmatch.o backupfile.o error.o fnmatch.o ftruncate.o getdate_stub.o getopt.o getopt1.o getversion.o modechange.o msleep.o xgetcwd.o xmalloc.o xstrdup.o
cd ..
## tar
# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic
# This is to avoid running configure test to determine sizeof(long long)
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/arith.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/buffer.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/compare.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/create.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/delete.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/extract.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD -DHAVE_DIRENT_H src/incremen.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/list.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/mangle.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/misc.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD src/names.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/open3.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/rtapelib.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DPACKAGE=\"tar\" -DVERSION=\"1.12\" src/tar.c
tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/update.c
# Link
tcc -static -o ${bindir}/tar -L lib lib/libtar.a arith.o buffer.o compare.o create.o delete.o extract.o incremen.o list.o mangle.o misc.o names.o open3.o rtapelib.o tar.o update.o -ltar
# Install
cp tar ${prefix}/bin/tar
chmod 755 ${prefix}/bin/tar
cd ../..