asm/Makefile
author Markus Bröker<broeker.markus@googlemail.com>
Fri, 20 Oct 2017 06:46:47 +0200
changeset 170 5a11538e7bc8
parent 166 ecd6492274ad
permissions -rw-r--r--
hgignore added

      CC = gcc -g -ggdb
  CFLAGS = -Wall -O2 -Iinclude
 LDFLAGS =
    NASM = nasm -f elf64 -Iinclude/
  TARGET = stackinfo
OBJECTS  = main.o
OBJECTS += get_sp.o

.SUFFIXES: .c .asm

.c.o:
	@echo Compiling $< ...
	@$(CC) -c $(CFLAGS) -o $@ $<

.asm.o:
	@echo Assembling $< ...
	@$(NASM) $< -o $@

all: $(TARGET) decimal

$(TARGET): $(OBJECTS)
	@echo Linking $(OBJECTS) ...
	@$(CC) $(LDFLAGS) $(OBJECTS) -o $@

decimal: decimal.o
	$(CC) $(CFLAGS) -o $@ $<

.PHONY: clean uninstall

clean:
	rm -f $(TARGET) decimal *.o *~

install: $(TARGET) decimal
	install -d ~/bin
	install $(TARGET) decimal ~/bin

uninstall:
	rm -f ~/bin/decimal
	rm -f ~/bin/$(TARGET)