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
|
|
|
|
|
|
|
|
AFLAGS = -t $(SYS) -I../../asminc
|
|
|
|
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 \
|
|
|
|
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
|
2003-08-12 13:51:11 +00:00
|
|
|
S_OBJS = _cwd.o \
|
2005-04-21 21:26:15 +00:00
|
|
|
_environ.o \
|
2003-08-12 13:51:11 +00:00
|
|
|
_fdesc.o \
|
2002-09-18 20:47:22 +00:00
|
|
|
_file.o \
|
2002-11-23 17:52:38 +00:00
|
|
|
_fopen.o \
|
2002-09-18 20:47:22 +00:00
|
|
|
_heap.o \
|
2009-02-10 19:15:51 +00:00
|
|
|
_heapadd.o \
|
2004-07-17 12:05:36 +00:00
|
|
|
_heapblocksize.o\
|
2003-02-01 12:22:09 +00:00
|
|
|
_heapmaxavail.o \
|
|
|
|
_heapmemavail.o \
|
2000-11-30 23:04:24 +00:00
|
|
|
_oserror.o \
|
2003-02-01 21:49:55 +00:00
|
|
|
_printf.o \
|
2004-05-13 21:09:08 +00:00
|
|
|
_seterrno.o \
|
2003-02-01 21:49:55 +00:00
|
|
|
_swap.o \
|
|
|
|
_sys.o \
|
|
|
|
abs.o \
|
|
|
|
atexit.o \
|
|
|
|
atoi.o \
|
|
|
|
calloc.o \
|
2003-08-12 13:24:25 +00:00
|
|
|
chdir.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
copydata.o \
|
2003-06-12 09:10:50 +00:00
|
|
|
creat.o \
|
2002-11-12 22:06:02 +00:00
|
|
|
ctime.o \
|
2002-11-02 10:52:36 +00:00
|
|
|
divt.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
errno.o \
|
2002-11-24 19:13:38 +00:00
|
|
|
fclose.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
fmisc.o \
|
2002-11-23 18:46:40 +00:00
|
|
|
fopen.o \
|
2000-12-01 17:25:07 +00:00
|
|
|
fprintf.o \
|
2002-11-23 23:05:00 +00:00
|
|
|
fread.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
free.o \
|
2004-11-28 18:11:17 +00:00
|
|
|
fscanf.o \
|
2002-11-23 22:51:25 +00:00
|
|
|
fwrite.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
getcpu.o \
|
2003-08-12 13:51:11 +00:00
|
|
|
getcwd.o \
|
2005-04-21 21:26:15 +00:00
|
|
|
getenv.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
isalnum.o \
|
|
|
|
isalpha.o \
|
|
|
|
isblank.o \
|
|
|
|
iscntrl.o \
|
|
|
|
isdigit.o \
|
|
|
|
isgraph.o \
|
|
|
|
islower.o \
|
2000-08-11 21:44:39 +00:00
|
|
|
isprint.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
ispunct.o \
|
|
|
|
isspace.o \
|
|
|
|
isupper.o \
|
|
|
|
isxdigit.o \
|
|
|
|
itoa.o \
|
|
|
|
labs.o \
|
|
|
|
longjmp.o \
|
2000-07-21 16:57:58 +00:00
|
|
|
ltoa.o \
|
|
|
|
malloc.o \
|
|
|
|
maperrno.o \
|
|
|
|
memchr.o \
|
|
|
|
memcmp.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
memcpy.o \
|
2003-08-20 10:17:53 +00:00
|
|
|
memmove.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
memset.o \
|
2005-08-31 20:11:45 +00:00
|
|
|
mkdir.o \
|
2002-04-21 14:29:30 +00:00
|
|
|
modfree.o \
|
|
|
|
modload.o \
|
2003-08-12 13:06:43 +00:00
|
|
|
oserrcheck.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
printf.o \
|
2004-10-06 21:42:17 +00:00
|
|
|
putchar.o \
|
2005-04-21 21:26:15 +00:00
|
|
|
putenv.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
rand.o \
|
2003-03-14 11:12:38 +00:00
|
|
|
raise.o \
|
2003-08-13 07:31:01 +00:00
|
|
|
remove.o \
|
2003-08-12 13:06:43 +00:00
|
|
|
rename.o \
|
2005-08-31 20:11:45 +00:00
|
|
|
rmdir.o \
|
2005-02-14 09:19:59 +00:00
|
|
|
scanf.o \
|
2005-04-21 21:26:15 +00:00
|
|
|
searchenv.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
setjmp.o \
|
2003-03-14 11:12:38 +00:00
|
|
|
signal.o \
|
|
|
|
sigtable.o \
|
2000-12-01 17:32:59 +00:00
|
|
|
sprintf.o \
|
2004-11-28 18:23:16 +00:00
|
|
|
sscanf.o \
|
2000-07-21 16:57:58 +00:00
|
|
|
strcat.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
strchr.o \
|
|
|
|
strcmp.o \
|
|
|
|
strcoll.o \
|
|
|
|
strcpy.o \
|
|
|
|
strcspn.o \
|
2000-07-22 11:10:34 +00:00
|
|
|
strdup.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
strerror.o \
|
|
|
|
stricmp.o \
|
|
|
|
strlen.o \
|
|
|
|
strlower.o \
|
|
|
|
strncat.o \
|
|
|
|
strncmp.o \
|
|
|
|
strncpy.o \
|
2009-02-10 19:15:51 +00:00
|
|
|
strnicmp.o \
|
2002-07-18 13:29:04 +00:00
|
|
|
stroserr.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
strpbrk.o \
|
|
|
|
strrchr.o \
|
|
|
|
strspn.o \
|
|
|
|
strstr.o \
|
|
|
|
strupper.o \
|
2002-11-12 19:54:30 +00:00
|
|
|
time.o \
|
2000-07-16 22:09:58 +00:00
|
|
|
tolower.o \
|
|
|
|
toupper.o \
|
2003-08-12 14:24:34 +00:00
|
|
|
uname.o \
|
2004-05-13 21:39:17 +00:00
|
|
|
ungetc.o \
|
2003-06-12 08:43:57 +00:00
|
|
|
unlink.o \
|
2003-08-12 17:24:02 +00:00
|
|
|
utscopy.o \
|
2000-12-01 15:05:46 +00:00
|
|
|
vfprintf.o \
|
2004-11-27 14:56:54 +00:00
|
|
|
vfscanf.o \
|
2003-06-02 16:08:26 +00:00
|
|
|
vprintf.o \
|
2004-11-27 18:23:24 +00:00
|
|
|
vscanf.o \
|
2000-12-01 22:57:32 +00:00
|
|
|
vsprintf.o \
|
2004-11-28 18:45:13 +00:00
|
|
|
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
|
|
|
|
|