* Christmas edition *; fixed irc /os command; small cleanup in fd.c; improvements...
[ZeXOS.git] / apps / zasm / Makefile
bloba1c9e01a814299c676da82c4fc39ad95a41a3ba6
1 .SUFFIXES: .asm
3 # defines
4 MAKEFILE=Makefile
5 MAKEDEP=$(MAKEFILE)
6 NASM =nasm -f elf
7 GLIBC =../../libc
8 LSCRIPT =./link.ld
9 LFLAGS =-g -T$(LSCRIPT)
10 INCDIR =$(GLIBC)/include
11 CC =gcc -m32 -g -O2 -Wall -W -c -nostdinc -fno-builtin -fno-stack-protector -I$(INCDIR)
12 #-Wall -W
13 LD =ld -m elf_i386 -s -nostdlib
14 LIBC =$(GLIBC)/libc.a
15 OBJS =start.o main.o source.o buffer.o
17 # targets
18 all: zasm
20 install: zasm
21 mkdir mnt
22 mount /dev/fd0 mnt
23 cp -f zasm ./mnt/zasm
24 umount mnt
25 rmdir mnt
27 linux:
28 gcc -o zasm main.c source.c buffer.c
29 clean:
30 rm -f *.o zasm $(OBJS)
31 # implicit rules
32 .asm.o:
33 $(NASM) -o$@ $<
35 .c.o:
36 $(CC) -c -o$@ $<
38 #: dependencies
39 # asm
40 start.o: start.asm $(MAKEDEP)
41 # C
42 main.o: main.c $(MAKEDEP)
43 source.o: source.c $(MAKEDEP)
44 buffer.o: buffer.c $(MAKEDEP)
46 # explicit rules
47 zasm: $(OBJS) $(LIBC) $(MAKEDEP)
48 $(LD) $(LFLAGS) -o$@ $(OBJS) $(LIBC)