Fixed bug with uninitialized hostname in shell
[ZeXOS.git] / libc / Makefile
blob9b27094b157eac08d1313c71de90a0ef7d48288f
1 .SUFFIXES: .asm
3 # defines
4 MAKEFILE=Makefile
5 MAKEDEP=$(MAKEFILE)
6 INCDIR =./include
7 NASM =nasm -f elf -i$(INCDIR)/
8 CC =gcc -m32 -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR)
10 STDIO =stdio/doprintf.o stdio/delay.o stdio/printf.o stdio/sprintf.o stdio/puts.o stdio/putch.o stdio/cls.o stdio/getch.o stdio/getkey.o stdio/gotoxy.o stdio/setcolor.o stdio/beep.o stdio/open.o stdio/close.o stdio/read.o stdio/write.o stdio/doscanf.o stdio/scanf.o stdio/getchar.o stdio/putchar.o stdio/fopen.o stdio/fclose.o stdio/fread.o stdio/fwrite.o stdio/fgetc.o stdio/fgets.o stdio/feof.o stdio/fileno.o stdio/fseek.o stdio/ftell.o stdio/fprintf.o stdio/fputc.o stdio/fdopen.o stdio/ferror.o stdio/fflush.o stdio/clearerr.o stdio/perror.o stdio/putc.o stdio/dosscanf.o stdio/sscanf.o stdio/fputs.o stdio/remove.o stdio/rename.o
11 STRING =string/memset.o string/memsetw.o string/memcpy.o string/memcmp.o string/memchr.o string/strlen.o string/strchr.o string/strcpy.o string/strncpy.o string/strcat.o string/strncat.o string/strcmp.o string/strstr.o string/strspn.o string/strdup.o string/strndup.o string/strpbrk.o string/strerror.o string/memmove.o
12 STRINGS =strings/strcasecmp.o
13 STDLIB =stdlib/memory.o stdlib/exit.o stdlib/schedule.o stdlib/strtol.o stdlib/atoi.o stdlib/itoa.o stdlib/abort.o stdlib/abs.o stdlib/system.o stdlib/rand.o stdlib/random.o stdlib/getenv.o stdlib/strtoul.o stdlib/mkstemp.o stdlib/qsort.o
14 UNISTD =unistd/sleep.o unistd/fcntl.o unistd/dup.o unistd/lseek.o unistd/unlink.o unistd/pipe.o unistd/getpid.o unistd/chdir.o unistd/getcwd.o unistd/access.o
15 SOCKET =socket/connect.o socket/socket.o socket/send.o socket/gethostbyname.o socket/htons.o socket/recv.o socket/bind.o socket/listen.o socket/accept.o socket/sendto.o socket/recvfrom.o socket/inet_ntop.o socket/inet_pton.o socket/inet_ntoa.o socket/setsockopt.o socket/inet_addr.o
16 SIGNAL =signal/signal.o
17 VFS =vfs/mount.o
18 TIME =time/time.o time/localtime.o time/gettimeofday.o time/mktime.o
19 CTYPE =ctype/ctype.o
20 ERRNO =errno/errno.o
21 SYS =sys/ioctl.o sys/creat.o sys/mkdir.o sys/rmdir.o sys/select.o sys/stat.o sys/lstat.o sys/umask.o sys/chmod.o
22 DIRENT =dirent/opendir.o dirent/readdir.o dirent/closedir.o
24 OBJS =$(STDIO) $(STRING) $(STRINGS) $(STDLIB) $(UNISTD) $(SOCKET) $(SIGNAL) $(VFS) $(TIME) $(CTYPE) $(ERRNO) $(SYS) $(DIRENT)
26 ifneq ($(V),1)
27 Q := @
28 endif
30 # targets
31 all: $(OBJS) libc.a
33 clean:
34 $(Q)rm -f libc.a $(OBJS)
35 @printf " CLEAN\n";
37 # implicit rules
38 .S.o:
39 @printf " ASM $(subst $(shell pwd)/,,$(@))\n";
40 $(Q)$(NASM) -o$@ $<
42 .c.o:
43 @printf " CC $(subst $(shell pwd)/,,$(@))\n";
44 $(Q)$(CC) -c -o$@ $<
46 # explicit rules
47 libc.a: $(OBJS) $(MAKEDEP)
48 @printf " AR $(subst $(shell pwd)/,,$(@))\n";
49 $(Q)ar rcs libc.a $(OBJS)