Update the Makefile to work with the propeller-gcc Makefile.

This commit is contained in:
David Betz 2015-03-22 14:16:21 -04:00
parent bdd3741b10
commit edd7a60d3c
1 changed files with 16 additions and 7 deletions

23
Makefile Executable file → Normal file
View File

@ -1,25 +1,34 @@
TARGET = spinsim # CC, EXT, and BUILD may be overridden by a top level makefile (e.g. for
# cross compiling)
CC = gcc
EXT =
BUILD = ./obj
TARGET = spinsim$(EXT)
SOURCES = spinsim.c spininterp.c spindebug.c pasmsim.c pasmdebug.c pasmsim2.c pasmdebug2.c eeprom.c debug.c gdb.c SOURCES = spinsim.c spininterp.c spindebug.c pasmsim.c pasmdebug.c pasmsim2.c pasmdebug2.c eeprom.c debug.c gdb.c
OBJECTS = $(SOURCES:.c=.o)
ifneq ($(OS),msys) ifneq ($(OS),msys)
SOURCES += conion.c SOURCES += conion.c
endif endif
CC = gcc OBJECTS = $(patsubst %,$(BUILD)/%, $(SOURCES:.c=.o))
# I'm not sure why these linker flags were being used but the break the build on Mac OS X so I've # I'm not sure why these linker flags were being used but the break the build on Mac OS X so I've
# commented them out for the time being # commented them out for the time being
#LDFLAGS = -Wl,--relax -Wl,--gc-sections #LDFLAGS = -Wl,--relax -Wl,--gc-sections
LDFLAGS = LDFLAGS =
OPT := -O3 OPT := -O3
CFLAGS = -c -g -Wall -Wno-format $(OPT) -I/usr/include -D LINUX CFLAGS = -c -g -Wall -Wno-format $(OPT) -D LINUX
all: $(SOURCES) $(OBJECTS) Makefile all: directory $(SOURCES) $(OBJECTS) Makefile
$(CC) $(LDFLAGS) $(OBJECTS) -o $(TARGET) $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS)
directory:
mkdir -p $(BUILD)
# Compile .c files into objexts .o # Compile .c files into objexts .o
.c.o: $(BUILD)/%.o: %.c
$(CC) $(CFLAGS) $< -o $@ $(CC) $(CFLAGS) $< -o $@
clean: FORCE clean: FORCE