Skip to content
Merged

Oot #46

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:

- name: Build
run: |
make -j 9
sudo make install
make deb
sudo dpkg -i ../dj64*.deb

- name: Set up test environment
run: |
Expand Down
9 changes: 9 additions & 0 deletions Makefile.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ datarootdir := @datarootdir@
datadir := @datadir@
includedir := @includedir@

abs_top_srcdir = @abs_top_srcdir@
abs_top_builddir = @abs_top_builddir@
SUBDIR = $(patsubst /%,%,$(subst $(abs_top_builddir)/src,,$(CURDIR)))
srcdir = $(patsubst %/,%,$(abs_top_srcdir)/src/$(SUBDIR))
vpath %.c $(srcdir)
vpath %.h $(srcdir)
vpath %.S $(srcdir)
vpath %.s $(srcdir)

CC := @CC@
CC_FOR_BUILD := @CC_FOR_BUILD@
CC_IS_CLANG := @CC_IS_CLANG@
Expand Down
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ AC_PROG_CPP
AC_PROG_INSTALL
AX_PROG_CC_FOR_BUILD
#AX_PROG_AR
AC_PROG_LN_S
AC_PROG_SED
AC_PROG_GREP

AC_CHECK_PROGS([PKG_CONFIG], [pkg-config])
if test -z "$PKG_CONFIG"; then
Expand Down Expand Up @@ -242,4 +245,23 @@ AC_CHECK_TYPES([__float80])
AC_CHECK_FUNCS([dlmopen])
AC_CHECK_DECLS([RTLD_DEEPBIND],,, [[#include <dlfcn.h>]])

if ! test -f Makefile.conf.in; then
AC_MSG_NOTICE([Populating makefiles...])
wd=`pwd`
abssrcdir=`cd $srcdir && pwd`
if test "${wd#$abssrcdir}" != "$wd" ; then
builddir=".${wd#$abssrcdir}"
else
builddir="$wd"
fi
mkdir -p `(cd $abssrcdir; find src demos -type d -print)`
$LN_S -f $abssrcdir/Makefile.conf.in Makefile.conf.in
for i in `(cd $abssrcdir; find . \( -path './demos/*' -o -path './src/*' \
-o -path ./makefile \) -a -name 'makefile' -print
)`; do
echo $LN_S -f $abssrcdir/${i#./} $i
$LN_S -f $abssrcdir/${i#./} $i
done
fi

AC_OUTPUT
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/make -f

%:
dh $@ --parallel
dh $@ --parallel --builddirectory=build

override_dh_autoreconf:
dh_autoreconf ./autogen.sh
22 changes: 11 additions & 11 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ all: Makefile.conf dj64 djdev64 ncurses
@echo "Done building. You may need to run \"sudo make install\" now."
@echo "You can first run \"sudo make uninstall\" to purge the prev install."

Makefile.conf config.status: Makefile.conf.in configure
./configure
Makefile.conf config.status: Makefile.conf.in $(abs_top_srcdir)/configure
$(abs_top_srcdir)/configure

configure: configure.ac
autoreconf -v -i -I m4
$(abs_top_srcdir)/configure: $(abs_top_srcdir)/configure.ac
cd $(@D) && autoreconf -v -i -I m4

subs:
$(MAKE) -C src
Expand All @@ -65,9 +65,9 @@ install_dj64:
cp -fP $(DJ64DEVL) $(DESTDIR)$(prefix)/i386-pc-dj64/lib64
$(INSTALL) -m 0644 $(DJ64LIBS) $(DESTDIR)$(prefix)/i386-pc-dj64/lib64
$(INSTALL) -d $(DESTDIR)$(prefix)/i386-pc-dj64/include
cp -r $(TOP)/include $(DESTDIR)$(prefix)/i386-pc-dj64
cp -r $(abs_top_srcdir)/include $(DESTDIR)$(prefix)/i386-pc-dj64
$(INSTALL) -d $(DESTDIR)$(prefix)/i386-pc-dj64/share
$(INSTALL) -m 0644 dj64.mk $(DESTDIR)$(prefix)/i386-pc-dj64/share
$(INSTALL) -m 0644 $(abs_top_srcdir)/dj64.mk $(DESTDIR)$(prefix)/i386-pc-dj64/share
$(INSTALL) -d $(DESTDIR)$(datadir)
$(INSTALL) -d $(DESTDIR)$(datadir)/pkgconfig
$(INSTALL) -m 0644 dj64.pc $(DESTDIR)$(datadir)/pkgconfig
Expand All @@ -83,7 +83,7 @@ install_djdev64:
$(INSTALL) -m 0644 djdev64.pc $(DESTDIR)$(datadir)/pkgconfig
$(INSTALL) -m 0644 djstub64.pc $(DESTDIR)$(datadir)/pkgconfig
$(INSTALL) -d $(DESTDIR)$(includedir)/djdev64
cp -rL $(TOP)/src/djdev64/include/djdev64 $(DESTDIR)$(includedir)
cp -rL $(abs_top_srcdir)/src/djdev64/include/djdev64 $(DESTDIR)$(includedir)
$(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL) -m 0755 $(DJDEV64LIB) $(DESTDIR)$(libdir)
cp -fP $(DJDEV64DEVL) $(DESTDIR)$(libdir)
Expand Down Expand Up @@ -122,10 +122,10 @@ ifeq ($(NCURSES),1)
endif

deb:
debuild -i -us -uc -b && $(MAKE) clean >/dev/null
debuild -i -us -uc -b

rpm:
make clean
$(MAKE) clean
rpkg local && $(MAKE) clean >/dev/null

demos:
Expand All @@ -146,7 +146,7 @@ install_demos:
$(DJ64DEVL): subs

ifeq ($(NCURSES),1)
L_CPPFLAGS = $(shell PKG_CONFIG_PATH=$(ATOP) pkg-config --variable=xcppflags --define-variable=dj64prefix=$(ATOP) dj64)
L_CPPFLAGS = $(shell PKG_CONFIG_PATH=$(ATOP) pkg-config --variable=xcppflags --define-variable=dj64prefix=$(abs_top_srcdir) dj64)
L_CFLAGS = $(shell PKG_CONFIG_PATH=$(ATOP) pkg-config --cflags dj64)
L_LIBS = $(shell PKG_CONFIG_PATH=$(ATOP) pkg-config --libs-only-L --libs-only-l --define-variable=libdir=$(ATOP)/lib dj64)
R_PREFIX = $(shell PKG_CONFIG_PATH=$(ATOP) pkg-config --variable=dj64prefix dj64)
Expand All @@ -163,7 +163,7 @@ $(NC_BUILD)/Makefile: dj64.pc | $(NC_BUILD) $(DJ64DEVL)
CFLAGS="$(CFLAGS) $(L_CFLAGS)" \
LIBS="$(L_LIBS)" \
LDFLAGS="$(L_LDFLAGS)" \
../configure --host=$(shell uname -m)-pc-linux-gnu \
$(abs_top_srcdir)/contrib/ncurses/configure --host=$(shell uname -m)-pc-linux-gnu \
--prefix=$(R_PREFIX) \
--libdir=$(R_LIBDIR) \
--without-manpages \
Expand Down
2 changes: 1 addition & 1 deletion src/djdev64/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TOP = ../..
include $(TOP)/Makefile.conf
SOURCES = djdev64.c elf.c djexec.c
OBJECTS = $(SOURCES:.c=.o)
CFLAGS += -iquote include -fpic -ggdb3 -Wall -Wmissing-prototypes -Og -MD \
CFLAGS += -iquote $(srcdir)/include -fpic -ggdb3 -Wall -Wmissing-prototypes -Og -MD \
$(LIBELF_CFLAGS)

%.o: %.c
Expand Down
4 changes: 2 additions & 2 deletions src/djdev64/stub/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ include $(TOP)/Makefile.conf
prefix ?= /usr/local
SOURCES = coff.c elf.c util.c stub.c dpmiwrp.c dos.c
OBJECTS = $(SOURCES:.c=.o)
CFLAGS += -iquote ../include -fpic -ggdb3 -Wall -Og -MD \
CFLAGS += -iquote $(srcdir)/../include -fpic -ggdb3 -Wall -Og -MD \
-DCRT0=\"$(prefix)/i386-pc-dj64/lib/crt0.elf\"
SYM_VER = 5

%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<

%.version: %.version.in makefile
%.version: $(srcdir)/%.version.in makefile
sed \
-e 's!@SYM_VER[@]!$(SYM_VER)!g' \
$< >$@
Expand Down
3 changes: 2 additions & 1 deletion src/dosemu2/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details
TOP = .

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc

all:: $(LIB)/elfload.com

Expand Down
3 changes: 2 additions & 1 deletion src/libc/ansi/assert/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../..

SRC += assert.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/ctype/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ SRC += iswalnum.c
SRC += iswalpha.c
SRC += iswdigit.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/errno/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../..

SRC += errno.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/locale/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ SRC += setlocal.c
SRC += wcstombs.c
SRC += wctomb.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/math/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ SRC += modfl.c
SRC += modf.c
SRC += huge_val.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/setjmp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ TOP=../..
#AS_SRC += longjmp.S
#AS_SRC += setjmp.S

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/stdio/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ SRC += vsprintf.c
SRC += snprintf.c
SRC += vsnprntf.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/stdlib/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ SRC += system.c
# here.
nmalloc.o: EXTRA_CFLAGS := -fno-builtin-malloc

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansi/string/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SRC += syserr1.c
SRC += syserr2.c
SRC += syserr3.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc

strlen.o: EXTRA_CFLAGS += -fno-builtin-strlen
3 changes: 2 additions & 1 deletion src/libc/ansi/time/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ SRC += difftime.c
SRC += strftime.c
SRC += time.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/ansif/float/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ SRC += float_le.c
SRC += float_lm.c
SRC += float_lx.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/bios/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ SRC += biosprin.c
SRC += biostime.c
SRC += b_time.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/c99/inttypes/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ SRC += imaxdiv.c
SRC += strimax.c
SRC += strumax.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/c99/math/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ SRC += sgnbitd.c
SRC += sgnbitf.c
SRC += sgnbitld.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
2 changes: 1 addition & 1 deletion src/libc/c99/math/rintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <stdint.h>

#define EPS FLT_EPSILON
static const float toint = 1/EPS;

float rintf(float x)
{
const float toint = 1/EPS;
union {float f; uint32_t i;} u = {x};
int e = u.i>>23 & 0xff;
int s = u.i>>31;
Expand Down
3 changes: 2 additions & 1 deletion src/libc/c99/stdlib/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ TOP=../..

SRC += strtof.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/bsd/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ SRC += bzero.c
SRC += index.c
SRC += rindex.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/go64/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ AS_SRC += pltctrl32.S
AS_SRC += upltinit32.S
SRC += elfexec.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/io/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TOP=../..

SRC += chsize.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/ioctl/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ TOP=../..

SRC += ioctl.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/mman/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../..

SRC += mprotect.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/mntent/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../..

SRC += mntent.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/search/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ TOP=../..
SRC += insque.c
SRC += remque.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/signal/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ TOP=../..
SRC += siglist.c
SRC += psignal.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/stdio/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ SRC += vscanf.c
#AS_SRC += vfscanf.S
SRC += vsscanf.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/stdlib/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ SRC += rand48.c
SRC += memalign.c
SRC += valloc.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/string/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ SRC += strnicmp.c
SRC += strsep.c
SRC += strupr.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc

stpcpy.o: EXTRA_CFLAGS += -fno-builtin-stpcpy
stpncpy.o: EXTRA_CFLAGS += -fno-builtin-stpncpy
Expand Down
3 changes: 2 additions & 1 deletion src/libc/compat/sys/resource/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ SRC += resource.c
SRC += gtrlimit.c
SRC += strlimit.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/sys/stat/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../../..

SRC += mknod.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
3 changes: 2 additions & 1 deletion src/libc/compat/sys/vfs/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TOP=../../..

SRC += statfs.c

include $(TOP)/../makefile.inc
include $(TOP)/../../Makefile.conf
include $(srcdir)/$(TOP)/../makefile.inc
Loading