1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-02 18:06:48 +00:00
cc65/libsrc/common/Makefile
uz 3afb4e4e94 Added getopt. The implementation is based on a public domain source,
originally written by Henry Spencer and supplied by Harald Arnesen.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4737 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-07-10 11:28:02 +00:00

221 lines
5.6 KiB
Makefile

# -*- makefile -*-
#
# makefile for CC65's common library
#
.SUFFIXES: .o .s .c
#--------------------------------------------------------------------------
# Programs and flags
SYS = none
AS = ../../src/ca65/ca65
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
# Rules
%.o: %.c
@$(CC) $(CFLAGS) $<
@$(AS) -g -o $@ $(AFLAGS) $(*).s
%.o: %.s
@$(AS) -g -o $@ $(AFLAGS) $<
#--------------------------------------------------------------------------
# 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 $<
#--------------------------------------------------------------------------
# Object files
# From C source-files
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 \
getopt.o \
gets.o \
gmtime.o \
locale.o \
localtime.o \
mktime.o \
perror.o \
pmemalign.o \
puts.o \
qsort.o \
realloc.o \
rewind.o \
sleep.o \
strftime.o \
strtok.o \
strtol.o \
strtoul.o \
strxfrm.o \
system.o \
timezone.o
# From assembly source-files
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 \
cc65_idiv32by16r16.o \
cc65_imul16x16r32.o \
cc65_sincos.o \
cc65_udiv32by16r16.o \
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 \
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 \
zerobss.o
#--------------------------------------------------------------------------
# Targets
.PHONY: all clean zap
all: $(C_OBJS) $(S_OBJS)
clean:
@$(RM) *~ *.lst
@$(RM) $(C_OBJS:.o=.s)
@$(RM) $(C_OBJS)
@$(RM) $(S_OBJS)
zap: clean