2005-02-14 09:19:59 +00:00
|
|
|
# -*- makefile -*-
|
2000-05-28 13:40:48 +00:00
|
|
|
#
|
2005-02-14 09:19:59 +00:00
|
|
|
# makefile for CC65's common library
|
2000-05-28 13:40:48 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
2004-10-26 19:28:26 +00:00
|
|
|
# Programs and flags
|
|
|
|
|
|
|
|
SYS = none
|
|
|
|
|
|
|
|
AS = ../../src/ca65/ca65
|
|
|
|
CC = ../../src/cc65/cc65
|
|
|
|
LD = ../../src/ld65/ld65
|
|
|
|
|
2009-12-18 11:58:50 +00:00
|
|
|
AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
|
2004-10-26 19:28:26 +00:00
|
|
|
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
2003-02-06 15:35:30 +00:00
|
|
|
# Rules
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
%.o: %.c
|
|
|
|
@$(CC) $(CFLAGS) $<
|
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $(*).s
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
|
|
|
|
2005-02-14 09:19:59 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Rules to help us see what code the compiler and assembler make.
|
|
|
|
|
|
|
|
%.s : %.c
|
|
|
|
@$(CC) $(CFLAGS) -S $<
|
|
|
|
|
|
|
|
%.lst : %.s
|
|
|
|
@$(AS) $(AFLAGS) -l -o /dev/null $<
|
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2005-02-14 09:19:59 +00:00
|
|
|
# From C source-files
|
2005-01-05 21:07:23 +00:00
|
|
|
C_OBJS = _afailed.o \
|
|
|
|
_hextab.o \
|
|
|
|
_poserror.o \
|
|
|
|
_scanf.o \
|
|
|
|
abort.o \
|
|
|
|
asctime.o \
|
|
|
|
bsearch.o \
|
|
|
|
errormsg.o \
|
|
|
|
fdopen.o \
|
|
|
|
fgetc.o \
|
|
|
|
fgetpos.o \
|
|
|
|
fgets.o \
|
|
|
|
fputc.o \
|
|
|
|
fputs.o \
|
|
|
|
freopen.o \
|
|
|
|
fseek.o \
|
|
|
|
fsetpos.o \
|
|
|
|
ftell.o \
|
|
|
|
getchar.o \
|
|
|
|
gets.o \
|
|
|
|
gmtime.o \
|
|
|
|
locale.o \
|
|
|
|
localtime.o \
|
|
|
|
mktime.o \
|
|
|
|
perror.o \
|
2005-07-24 12:57:00 +00:00
|
|
|
pmemalign.o \
|
2005-01-05 21:07:23 +00:00
|
|
|
puts.o \
|
|
|
|
qsort.o \
|
|
|
|
realloc.o \
|
|
|
|
rewind.o \
|
|
|
|
sleep.o \
|
|
|
|
strftime.o \
|
|
|
|
strtok.o \
|
2009-09-15 20:56:08 +00:00
|
|
|
strtol.o \
|
2009-09-15 21:45:25 +00:00
|
|
|
strtoul.o \
|
2009-09-15 20:56:08 +00:00
|
|
|
strxfrm.o \
|
2005-01-05 21:07:23 +00:00
|
|
|
system.o \
|
2004-11-28 18:45:13 +00:00
|
|
|
timezone.o
|
2001-03-10 14:19:21 +00:00
|
|
|
|
2005-02-14 09:19:59 +00:00
|
|
|
# From assembly source-files
|
2009-11-04 18:17:00 +00:00
|
|
|
S_OBJS = _cwd.o \
|
|
|
|
_environ.o \
|
|
|
|
_fdesc.o \
|
|
|
|
_file.o \
|
|
|
|
_fopen.o \
|
|
|
|
_heap.o \
|
|
|
|
_heapadd.o \
|
|
|
|
_heapblocksize.o \
|
|
|
|
_heapmaxavail.o \
|
|
|
|
_heapmemavail.o \
|
|
|
|
_oserror.o \
|
|
|
|
_printf.o \
|
|
|
|
_seterrno.o \
|
|
|
|
_swap.o \
|
|
|
|
_sys.o \
|
|
|
|
abs.o \
|
|
|
|
atexit.o \
|
|
|
|
atoi.o \
|
|
|
|
calloc.o \
|
2009-11-04 19:41:54 +00:00
|
|
|
cc65_idiv32by16r16.o \
|
2009-11-04 18:17:00 +00:00
|
|
|
cc65_imul16x16r32.o \
|
|
|
|
cc65_sincos.o \
|
2009-11-04 18:25:29 +00:00
|
|
|
cc65_udiv32by16r16.o \
|
2009-11-04 18:17:00 +00:00
|
|
|
cc65_umul16x16r32.o \
|
|
|
|
chdir.o \
|
|
|
|
copydata.o \
|
|
|
|
creat.o \
|
|
|
|
ctime.o \
|
|
|
|
divt.o \
|
|
|
|
errno.o \
|
|
|
|
fclose.o \
|
|
|
|
fmisc.o \
|
|
|
|
fopen.o \
|
|
|
|
fprintf.o \
|
|
|
|
fread.o \
|
|
|
|
free.o \
|
|
|
|
fscanf.o \
|
|
|
|
fwrite.o \
|
|
|
|
getcpu.o \
|
|
|
|
getcwd.o \
|
|
|
|
getenv.o \
|
|
|
|
isalnum.o \
|
|
|
|
isalpha.o \
|
|
|
|
isblank.o \
|
|
|
|
iscntrl.o \
|
|
|
|
isdigit.o \
|
|
|
|
isgraph.o \
|
|
|
|
islower.o \
|
|
|
|
isprint.o \
|
|
|
|
ispunct.o \
|
|
|
|
isspace.o \
|
|
|
|
isupper.o \
|
|
|
|
isxdigit.o \
|
|
|
|
itoa.o \
|
|
|
|
labs.o \
|
|
|
|
longjmp.o \
|
|
|
|
ltoa.o \
|
|
|
|
malloc.o \
|
|
|
|
memchr.o \
|
|
|
|
memcmp.o \
|
|
|
|
memcpy.o \
|
|
|
|
memmove.o \
|
|
|
|
memset.o \
|
|
|
|
mkdir.o \
|
|
|
|
modfree.o \
|
|
|
|
modload.o \
|
|
|
|
oserrcheck.o \
|
|
|
|
printf.o \
|
|
|
|
putchar.o \
|
|
|
|
putenv.o \
|
|
|
|
rand.o \
|
|
|
|
raise.o \
|
|
|
|
remove.o \
|
|
|
|
rename.o \
|
|
|
|
rmdir.o \
|
|
|
|
scanf.o \
|
|
|
|
searchenv.o \
|
|
|
|
setjmp.o \
|
|
|
|
signal.o \
|
|
|
|
sigtable.o \
|
|
|
|
snprintf.o \
|
|
|
|
sprintf.o \
|
|
|
|
sscanf.o \
|
|
|
|
strcat.o \
|
|
|
|
strchr.o \
|
|
|
|
strcmp.o \
|
|
|
|
strcoll.o \
|
|
|
|
strcpy.o \
|
|
|
|
strcspn.o \
|
|
|
|
strdup.o \
|
|
|
|
strerror.o \
|
|
|
|
stricmp.o \
|
|
|
|
strlen.o \
|
|
|
|
strlower.o \
|
|
|
|
strncat.o \
|
|
|
|
strncmp.o \
|
|
|
|
strncpy.o \
|
|
|
|
strnicmp.o \
|
|
|
|
stroserr.o \
|
|
|
|
strpbrk.o \
|
|
|
|
strrchr.o \
|
|
|
|
strspn.o \
|
|
|
|
strstr.o \
|
|
|
|
strtoimax.o \
|
|
|
|
strtoumax.o \
|
|
|
|
strupper.o \
|
|
|
|
time.o \
|
|
|
|
tolower.o \
|
|
|
|
toupper.o \
|
|
|
|
uname.o \
|
|
|
|
ungetc.o \
|
|
|
|
unlink.o \
|
|
|
|
utscopy.o \
|
|
|
|
vfprintf.o \
|
|
|
|
vfscanf.o \
|
|
|
|
vprintf.o \
|
|
|
|
vscanf.o \
|
|
|
|
vsnprintf.o \
|
|
|
|
vsprintf.o \
|
|
|
|
vsscanf.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
zerobss.o
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Targets
|
|
|
|
|
|
|
|
.PHONY: all clean zap
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
all: $(C_OBJS) $(S_OBJS)
|
|
|
|
|
|
|
|
clean:
|
2005-02-14 09:19:59 +00:00
|
|
|
@$(RM) *~ *.lst
|
|
|
|
@$(RM) $(C_OBJS:.o=.s)
|
|
|
|
@$(RM) $(C_OBJS)
|
|
|
|
@$(RM) $(S_OBJS)
|
2000-11-20 21:59:43 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
zap: clean
|
|
|
|
|