File:  [Atari MiNT] / MiNT / src / purec / makefile.pcc
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:56:11 2018 UTC (8 years, 1 month ago) by root
Branches: mint, MAIN
CVS tags: mint096, HEAD
MiNT 0.96 pl14

#

# Makefile for MiNT using the Pure CC

#



# if you're cross-compiling, define NATIVECC

# to the host's C compiler, NATIVECFLAGS to

# the appropriate flags for it, and NATIVELIBS

# to appropriate libraries

# NATIVECC = cc

# NATIVECFLAGS = -g

# NATIVELIBS =



NATIVECC = gcc

NATIVECFLAGS = -O

NATIVELIBS = -liio



#

# depending on your version of bison/yacc, you may

# need to change these names, e.g. to

# YACC = yacc

# YTABC = y.tab.c

# YTABH = y.tab.h



YACC = bison -d

YTABC = asm,tab.c

YTABH = asm,tab.h



# here are defs for the cross compiler

# MiNT must be compiled with 16 bit integers



CC = cc -g

AS = cc -Wa,-2 -Wa,-8 -Wa,-S -c

#MODEL = -mshort -m68020

LIBS = -lpctoslib.lib



# add -DEZMINT for smaller MiNT

DEFS = -DFASTTEXT -DOWN_LIB



# if you have an older version of gcc, it won't understand -G;

# that won't hurt anything (it just controls the format of the

# symbol table) so just delete the -G. Do *not* change it into

# -g!!!

#

CFLAGS =  -D__STDC__ -W0,-P $(MODEL) $(DEFS)





COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \

	filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \

	biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \

	unifs.o shmfs.o fasttext.o



CSRCS = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \

	filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \

	biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \

	unifs.c shmfs.c fasttext.c



SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o



OBJS = $(COBJS) $(SOBJS)



mint.prg: $(OBJS)

	$(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)



$(SOBJS): proc.h

$(COBJS): mint.h proc.h file.h



main.o: version.h

bios.o: inline.h



#

# assembler source files are now handled in a radically different

# fashion. We build a pre-processor program, asmtrans, that

# takes the .spp files, merges them with an include file that

# gives various offsets into structures of interest, and produces

# the .s files as output. This has two major advantages:

# (1) it lets us use the same source for both the Lattice and

#     gcc assembler files (the translator will convert), and

# (2) if we change the CONTEXT or PROC structures, we don't

#     have to dig through the source code looking for

#     magic numbers



# the asm translator program

# Note that this must be compiled with the native CC of whatever

# system you're using; see the definitions at the top of this

# file.



ATRANSOBJ = asmtab.o trutil.o trans.o

ATRANS = asmtrans.ttp



$(ATRANS): $(ATRANSOBJ)

	$(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \

		$(NATIVELIBS)



asmtab.o: asmtab.c asmtrans.h

	$(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<



trutil.o: trutil.c asmtrans.h

	$(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<



trans.o: trans.c asmtrans.h

	$(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<





asmtab.c asmtab.h:	asm.y

	$(YACC) asm.y

	mv $(YTABC) asmtab.c

	mv $(YTABH) asmtab.h



# the magic number include file is generated automagically

# NOTE that of course, magic.i can only reliably be generated

# on an Atari ST; if you're cross-compiling, you'll have

# to edit magic.i by hand

# for cross compilers; uncomment the following definitions

# and comment out the other ones below



# for cross-compiling



# GENMAGICPRG=echo

# magic.i: proc.h file.h genmagic.c

#	echo "Warning: magic.i may be out of date"



#for native compiling



GENMAGICPRG=genmagic.ttp



$(GENMAGICPRG): genmagic.c proc.h file.h

	$(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c



magic.i: $(GENMAGICPRG)

	$(GENMAGICPRG) $@



#

# assembler source files

#

.SUFFIXES: .spp



.spp.s:

	$(ATRANS) -purec -o $@ $<



context.o: context.spp magic.i $(ATRANS)

intr.o: intr.spp magic.i $(ATRANS)

syscall.o: syscall.spp magic.i $(ATRANS)

quickzer.o: quickzer.spp $(ATRANS)

quickmov.o: quickmov.spp $(ATRANS)

cpu.o: cpu.spp $(ATRANS)



#

# mkptypes generates prototypes from C source code. If you don't have it,

# you'll have to add/delete function prototypes by hand.

# also: Sozobon users will have to edit proto.h by hand to change the

#    #if defined(__STDC__) || defined(__cplusplus)

# line into

#    #if __STDC__

#

proto.h: $(CSRCS)

	mkptypes $(CSRCS) >proto.h



#

# macros for cleaning up

#

GENFILES= $(OBJS) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)

EXTRAS= asmtab.c asmtab.h mint.prg



clean:

	$(RM) $(GENFILES)



realclean:

	$(RM) $(GENFILES) $(EXTRAS)


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.