asm/Makefile
changeset 5 d752cbe8208e
child 66 2b4f786d9073
equal deleted inserted replaced
4:236f8f747073 5:d752cbe8208e
       
     1 CC=gcc -g -ggdb
       
     2 CFLAGS=-Wall -O2 -Iinclude
       
     3 LDFLAGS=
       
     4 NASM=nasm -f elf -Iinclude/
       
     5 TARGET=stackinfo
       
     6 OBJECTS=main.o get_sp.o
       
     7 
       
     8 .SUFFIXES: .c .asm
       
     9 
       
    10 .c.o:
       
    11 	@echo Compiling $< ...
       
    12 	@$(CC) -c $(CFLAGS) -o $@ $<
       
    13 
       
    14 .asm.o:
       
    15 	@echo Assembling $< ...
       
    16 	@$(NASM) $< -o $@
       
    17 
       
    18 all: $(TARGET) decimal
       
    19 
       
    20 $(TARGET): $(OBJECTS)
       
    21 	@echo Linking $(OBJECTS) ...
       
    22 	@$(CC) $(LDFLAGS) $(OBJECTS) -o $@
       
    23 
       
    24 decimal: decimal.o
       
    25 	$(CC) $(CFLAGS) -o $@ $<
       
    26 
       
    27 .PHONY: clean uninstall
       
    28 
       
    29 clean:
       
    30 	rm -f $(TARGET) decimal *.o *~
       
    31 
       
    32 install: $(TARGET) decimal
       
    33 	install -d ~/bin
       
    34 	install $(TARGET) decimal ~/bin
       
    35 
       
    36 uninstall:
       
    37 	rm -f ~/bin/decimal
       
    38 	rm -f ~/bin/$(TARGET)
       
    39