summaryrefslogtreecommitdiff
path: root/libc/stdlib/Makefile
blob: c45cd2840fef450761e240fcea82cfd4ee443ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.

LIBC=../libc.a

CC=$(CROSS)gcc
AR=$(CROSS)ar
RANLIB=$(CROSS)ranlib

CCFLAGS= -O2 $(CPUFLAGS) -fno-builtin -I../include

MSRC=aliases.c
MOBJ=abs.o remove.o creat.o bcopy.o bzero.o
# raise.o bcmp.o index.o rindex.o 


ESRC=atexit.c
EOBJ=on_exit.o atexit.o __do_exit.o exit.o

GOBJ=atoi.o atol.o ltoa.o ltostr.o \
     ctype.o qsort.o bsearch.o rand.o lsearch.o getopt.o \
     itoa.o strtol.o crypt.o sleep.o mkstemp.o mktemp.o

UOBJ=getenv.o putenv.o popen.o system.o getcwd.o setenv.o \
     execl.o execv.o execlp.o execvp.o execvep.o


OBJ=$(MOBJ) $(EOBJ) $(GOBJ) $(UOBJ)

## No ELKS strtod() until BCC does 16 bit FP...
#ifneq ($(LIB_CPU),i86)
#OBJ+=strtod.o
#endif

CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)

all: $(LIBC)
	@$(RM) $(OBJ)

$(LIBC): $(LIBC)($(OBJ))

$(LIBC)($(MOBJ)): $(MSRC)
	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
	$(AR) $(ARFLAGS) $@ $*.o

$(LIBC)($(EOBJ)): $(ESRC)
	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
	$(AR) $(ARFLAGS) $@ $*.o

clean:
	rm -f *.o libc.a

$(LIBC)(strtol.o): strtol.c
	$(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c
	$(AR) $(ARFLAGS) $@ $*.o

$(LIBC)(strtod.o): strtod.c
	$(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c
	$(AR) $(ARFLAGS) $@ $*.o

$(LIBC)(crypt.o): crypt.c
	$(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c
	$(AR) $(ARFLAGS) $@ $*.o