LD = ld
AS = as 
CC = gcc
CFLAGS = -Wall -O2 -g
LFLAGS = 

all:	hello_exit_x86 hello_world hello_world.static hello_world_x86 \
	print_string_x86

hello_world:	hello_world.o
	$(CC) $(LFLAGS) -o hello_world hello_world.o

hello_world.static:	hello_world.o
	$(CC) $(LFLAGS) -static -o hello_world.static hello_world.o

hello_world.o:	hello_world.c
	$(CC) $(CFLAGS) -c hello_world.c

hello_exit_x86:	hello_exit_x86.o
	$(LD) -o hello_exit_x86 hello_exit_x86.o

hello_exit_x86.o:	hello_exit_x86.s
	$(AS) -o hello_exit_x86.o hello_exit_x86.s


hello_world_x86:	hello_world_x86.o
	$(LD) -o hello_world_x86 hello_world_x86.o

hello_world_x86.o:	hello_world_x86.s
	$(AS) -o hello_world_x86.o hello_world_x86.s

print_string_x86:	print_string_x86.o
	$(LD) -o print_string_x86 print_string_x86.o

print_string_x86.o:	print_string_x86.s
	$(AS) -o print_string_x86.o print_string_x86.s

clean:	
	rm -f *~ *.o hello_exit_x86 hello_world hello_world_x86 hello_world.static hello_world.s print_string_x86
