head	1.10;
access;
symbols;
locks
	rluebbert:1.10; strict;
comment	@# @;


1.10
date	94.09.03.15.49.41;	author rluebbert;	state Exp;
branches;
next	1.9;

1.9
date	94.09.03.15.38.05;	author rluebbert;	state Exp;
branches;
next	1.8;

1.8
date	94.08.27.23.30.05;	author rluebbert;	state Exp;
branches;
next	1.7;

1.7
date	94.08.27.14.21.38;	author rluebbert;	state Exp;
branches;
next	1.6;

1.6
date	94.08.27.11.34.06;	author rluebbert;	state Exp;
branches;
next	1.5;

1.5
date	94.08.26.15.38.09;	author rluebbert;	state Exp;
branches;
next	1.4;

1.4
date	94.08.26.15.29.04;	author rluebbert;	state Exp;
branches;
next	1.3;

1.3
date	94.07.20.03.06.05;	author rluebbert;	state Exp;
branches;
next	1.2;

1.2
date	94.07.19.18.15.46;	author rluebbert;	state Exp;
branches;
next	1.1;

1.1
date	94.07.19.18.09.59;	author rluebbert;	state Exp;
branches;
next	;


desc
@Generic makefile for 68000-68030
@


1.10
log
@68000 still fucking with me.
@
text
@CC=gcc
CFLAGS= -O2 -m68030 -m68881 -fomit-frame-pointer -funroll-loops -DISA680X0 -DISAFPU
CBARE = -m68030 -m68881 -fomit-frame-pointer -funroll-loops -DISA680X0 -DISAFPU
INCS=
CSW=-c
DEBUG =
# debugstub.o
DEBUGS =
# debugstub.s
SYMBOL = -Xlinker -s

.s.o:
	cp $< x.c
	$(CC) $(CFLAGS) -traditional -E x.c -o x.s
	$(CC) $(CFLAGS) $(INCS) $(CSW) x.s -o $@@

.s.ot:
	cp $< x.c
	$(CC) $(CFLAGS) -traditional -DTRACE_LIBRARY -E x.c -o x.s
	$(CC) $(CFLAGS) $(INCS) $(CSW) x.s -o $@@

.c.o:
	$(CC) $(CFLAGS) $(INCS) $(CSW) $<

.c.ot:
	$(CC) $(CFLAGS) -DTRACE_LIBRARY $(INCS) $(CSW) $< -o $@@


all: ixemul.library ixemul.trace ixconfig

SRCS =  start.s version.c __close.c __fioctl.c __fselect.c __fstat.c __init_std_packet.c \
	__ioctl.c __ioerr_to_errno.c __lock.c __make_link.c __mclose.c __mread.c \
	__open.c __plock.c __read.c __swrite.c __tioctl.c __unlock.c \
	__wait_packet.c __write.c access.c chdir.c chmod.c close.c creat.c \
	fchmod.c fsync.c ftime.c ftruncate.c getpriority.c getrlimit.c gettimeofday.c \
	getcrap.c ioctl.c isatty.c ix_close.c ix_expunge.c ix_init.c \
	ix_open.c link.c lseek.c malloc.c mkdir.c open.c read.c \
	readlink.c readv.c rename.c rmdir.c select.c smallfuncs.c \
	setpriority.c setrlimit.c settimeofday.c stat.c symlink.c truncate.c \
	umask.c unlink.c utime.c utimes.c write.c writev.c \
	ix_panic.c kern_sig.c trap.s dsyscall.c kern_time.c ix_timer.c \
	kern_descrip.c ix_startup.c _cli_parse.c _wb_parse.c _main.c \
	createextio.c createport.c createstdio.c createtask.c \
	deleteextio.c deleteport.c deletestdio.c deletetask.c \
	exit.c __pipe.c pipe.c convert_dir.c \
	opendir.c readdir.c rewinddir.c closedir.c telldir.c seekdir.c \
	ix_patch_functions.c __load_seg.c mathsup.c kmalloc.c \
	ix_get_vars2.c ix_exec_entry.c vfork.c ix_sleep.c profil.c ptrace.c \
	__amiga_filehandle.c fchdir.c get_file.c ix_resident.c \
	posixconf.c ix_stubs.c statfs.c ix_sigwinch.c buddy-alloc.c hwck.c $(DEBUGS)
OBJS =  version.o __close.o __fioctl.o __fselect.o __fstat.o __init_std_packet.o \
	__ioctl.o __ioerr_to_errno.o __lock.o __make_link.o __mclose.o __mread.o \
	__open.o __plock.o __read.o __swrite.o __tioctl.o __unlock.o \
	__wait_packet.o __write.o access.o chdir.o chmod.o close.o creat.o \
	fchmod.o fsync.o ftime.o ftruncate.o getpriority.o getrlimit.o gettimeofday.o \
	getcrap.o ioctl.o isatty.o ix_close.o ix_expunge.o ix_init.o \
	ix_open.o link.o lseek.o malloc.o mkdir.o open.o read.o \
	readlink.o readv.o rename.o rmdir.o select.o smallfuncs.o \
	setpriority.o setrlimit.o settimeofday.o stat.o symlink.o truncate.o \
	umask.o unlink.o utime.o utimes.o write.o writev.o \
	ix_panic.o kern_sig.o trap.o kern_time.o ix_timer.o \
	kern_descrip.o ix_startup.o _cli_parse.o _wb_parse.o _main.o \
	createextio.o createport.o createstdio.o createtask.o \
	deleteextio.o deleteport.o deletestdio.o deletetask.o \
	exit.o __pipe.o pipe.o convert_dir.o \
	opendir.o readdir.o rewinddir.o closedir.o telldir.o seekdir.o \
	ix_patch_functions.o __load_seg.o mathsup.o kmalloc.o \
	ix_get_vars2.o ix_exec_entry.o vfork.o ix_sleep.o profil.o ptrace.o \
	__amiga_filehandle.o fchdir.o get_file.o ix_resident.o \
	posixconf.o ix_stubs.o statfs.o ix_sigwinch.o buddy-alloc.o hwck.o $(DEBUG)

OBJS1_N = start.o tracecntl.o

OBJS1_T = start.ot tracecntl.ot

ixemul.library: $(OBJS1_N) $(OBJS) $(OBJS1_D) machdep.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
	gcc -nostdlib -Xlinker -u -Xlinker Start $(SYMBOL) $(OBJS1_N) \
	$(OBJS) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library
	cp ixemul.library project:ixembuild/libdist/ixemul.library.030ffp

ixemul.library.68000: $(OBJS1_N) $(OBJS) $(OBJS1_D) machdep000.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulib/libgnu.a ../stdio_2/libstdio.a 
	gcc -nostdlib -Xlinker -u -Xlinker Start $(SYMBOL) $(OBJS1_N) \
	$(OBJS) machdep000.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
	../gnulib/libgnu.a ../stdio_2/libstdio.a -o ixemul.library
	cp ixemul.library project:ixembuild/libdist/ixemul.library.000

ixemul.library.68020noffp: $(OBJS1_N) $(OBJS) $(OBJS1_D) machdep.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulib/libgnu.a ../stdio_2/libstdio.a 
	gcc -nostdlib -Xlinker -u -Xlinker Start $(SYMBOL) $(OBJS1_N) \
	$(OBJS) machdep.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
	../gnulib/libgnu.a ../stdio_2/libstdio.a -o ixemul.library 
	cp ixemul.library project:ixembuild/libdist/ixemul.library.020noffp

ixemul.library.68020ffp: $(OBJS1_N) $(OBJS) $(OBJS1_D) machdep000.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
	gcc -nostdlib -Xlinker -u -Xlinker Start $(SYMBOL) $(OBJS1_N) \
	$(OBJS) machdep.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library
	cp ixemul.library project:ixembuild/libdist/ixemul.library.020ffp

ixconfig: ixconfig.c
	$(CC) $(CFLAGS) ixconfig.c -o ixconfig
	cp ixconfig project:ixembuild/libdist/ixconfig

ixemul.trace: $(OBJS1_T) $(OBJS) $(OBJS1_D) machdep000.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../stdio_2/libstdio.a
	gcc -nostdlib -Xlinker -u -Xlinker Start $(SYMBOL) $(OBJS1_T) $(OBJS)  \
	machdep000.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
	../gnulib/libgnu.a ../stdio_2/libstdio.a -o ixemul.trace
	cp ixemul.trace project:ixembuild/ixemul.trace

both:	ixemul.library ixemul.trace

clean:
	rm -f $(OBJS)

start.o: start.s version.h syscall.def

start.ot: start.s version.h syscall.def

# this depends on the size of struct user (besides files that need field
# from struct user)
ix_open.o: ../include/user.h

# Because gcc will trash it during optimization. Must be 030/881 compiled regardless of the
# target machine CPU type!
trap.o: trap.s
	co trap.s
	cp trap.s x.c
	$(CC) -m68030 -m68881 -fomit-frame-pointer -funroll-loops -DISA680X0 -DISAFPU -traditional -E x.c -o x.s
	$(CC) -m68030 -m68881 -fomit-frame-pointer -funroll-loops -DISA680X0 -DISAFPU $(INCS) $(CSW) x.s -o trap.o

hwck.o: hwck.c
	$(CC) $(CBARE) $(INCS) $(CSW) $*.c


machdep000.o: machdep000.c
	$(CC) $(CFLAGS) $(INCS) $(CSW) $*.c

machdep.o: machdep.c
	$(CC) $(CFLAGS) $(INCS) $(CSW) $*.c

ix_timer.o: ix_timer.c
	$(CC) -O2 -m68000 -msoft-float -c ix_timer.c

# those may not use A4, because they call back into the main program
ix_startup.o: ix_startup.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
debugstub.o: debugstub.s
	$(CC) $(CFLAGS) $(INCS) $(CSW) $*.s
_main.o: _main.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
ix_exec_entry.o: ix_exec_entry.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
exit.o: exit.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
ix_resident.o: ix_resident.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
tracecntl.o: tracecntl.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c
dsyscall.o: dsyscall.c
	$(CC) $(CFLAGS) -ffixed-a4 $(INCS) $(CSW) $*.c


##########################################################################
$(OBJS) $(OBJS1_N) $(OBJS1_T): ixemul.h

@


1.9
log
@Added machdep000.c for as136/68000 library compilations.
@
text
@d84 1
a84 1
	$(OBJS) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
d90 1
a90 1
	$(OBJS) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
d96 1
a96 1
	$(OBJS) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
d104 1
a104 1
ixemul.trace: $(OBJS1_T) $(OBJS) $(OBJS1_D) machdep.o ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../stdio_2/libstdio.a
d106 1
a106 1
	../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a \
d123 2
a124 1
# Because gcc 2.5.8 will trash it during optimization. Must be 68881 compiled!
@


1.8
log
@*** empty log message ***
@
text
@d41 1
a41 1
	ix_panic.c kern_sig.c machdep.c trap.s dsyscall.c kern_time.c ix_timer.c \
d61 1
a61 1
	ix_panic.o kern_sig.o machdep.o trap.o kern_time.o ix_timer.o \
d76 1
a76 1
ixemul.library: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
d82 1
a82 1
ixemul.library.68000: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulib/libgnu.a ../stdio_2/libstdio.a 
d88 1
a88 1
ixemul.library.68020noffp: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulib/libgnu.a ../stdio_2/libstdio.a 
d94 1
a94 1
ixemul.library.68020ffp: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
d104 1
a104 1
ixemul.trace: $(OBJS1_T) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../stdio_2/libstdio.a
d132 7
@


1.7
log
@*** empty log message ***
@
text
@d102 1
a102 1
	cp ixconfig project:ixembuild/libdist
@


1.6
log
@Made trap.s always 68881 compiled
@
text
@a76 1
	delete ixemul.library
@


1.5
log
@*** empty log message ***
@
text
@d124 1
a124 1
# Because gcc 2.5.8 will trash it during optimization.
d128 2
a129 2
	$(CC) $(CBARE) -traditional -E x.c -o x.s
	$(CC) $(CBARE) $(INCS) $(CSW) x.s -o trap.o
@


1.4
log
@.Changes ix_timer.c to work under all 68k CPUs.
@
text
@d77 1
d80 2
a81 1
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library 
d86 2
a87 1
	../gnulib/libgnu.a ../stdio_2/libstdio.a -o ixemul.library 
d93 1
d98 2
a99 1
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library 
d103 1
d109 1
@


1.3
log
@*** empty log message ***
@
text
@d128 1
a128 1
	$(CC) -O2 -m68000 -DISA680X0 -msoft-float -c ix_timer.c
@


1.2
log
@Added separate files for 68000, 68020noffp, 68020ffp
@
text
@d102 1
a102 1
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.trace
@


1.1
log
@Initial revision
@
text
@d81 1
a81 1
ixemul.library.68000: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
d84 1
a84 1
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library 
d86 1
a86 1
ixemul.library.68020noffp: $(OBJS1_N) $(OBJS) $(OBJS1_D) ../string/libstring.a ../gen_library/libgen.a ../stdlib/libstdlib.a ../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a 
d89 1
a89 1
	../gnulibfpu/libgnufpu.a ../stdio_2/libstdio.a -o ixemul.library 
@
