sh-dis/c/Makefile

37 lines
707 B
Makefile

DEBUG = -g -gdwarf-4
AFLAGS += --fatal-warnings
CFLAGS += -falign-functions=4 -ffunction-sections -fdata-sections -fshort-enums
CFLAGS += -Wall -Werror -Wfatal-errors -Wno-dangling-else
CFLAGS += -std=c2x
DEPFLAGS = -MMD -MP
SOFTFLOAT ?= ../../SoftFloat-3e
SOFTFLOAT_A ?= $(SOFTFLOAT)/build/Linux-x86_64-GCC/softfloat.a
SOFTFLOAT_I ?= $(SOFTFLOAT)/source/include
CFLAGS += -I$(SOFTFLOAT_I)
CC = $(TARGET)gcc
OBJS = \
decode_execute.o \
decode_print.o \
exception.o \
execute.o \
impl.o \
main.o \
ram.o \
$(SOFTFLOAT_A)
all: main
%.o: %.c
$(CC) $(CARCH) $(CFLAGS) $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@
main: $(OBJS)
$(CC) $^ -o $@
-include $(shell find -type f -name '*.d')