CSC231 Makefile for linking ASM and C Files
--D. Thiebaut 01:23, 27 October 2010 (UTC)
References
Makefile
CC = gcc
LD = gcc
NASM = nasm
CFLAGS = -c
LFLAGS =
NASMFLAGS = -f elf -F stabs
PROG = hw5test
OBJS = asm_io.o $(PROG).o driver.o
default: $(PROG)
$(PROG): $(OBJS)
$(LD) $(LFLAGS) $(OBJS) -o $(PROG)
asm_io.o: asm_io.asm
$(NASM) $(NASMFLAGS) asm_io.asm
$(PROG).o: $(PROG).asm asm_io.inc
$(NASM) $(NASMFLAGS) $(PROG).asm
driver.o: driver.c
$(CC) $(CFLAGS) driver.c
clean:
rm -rf *.o *~
real_clean:
rm -rf *.o $(PROG) *~