2018-06-25 11:19:35 +00:00
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
|
2018-04-06 12:25:26 +00:00
|
|
|
CFLAGS=-Wall -pedantic -I../src -g
|
2018-06-25 11:19:35 +00:00
|
|
|
LDFLAGS=-lgc
|
|
|
|
|
|
|
|
LDFLAGS_MACOSX=-L/opt/local/lib
|
|
|
|
CFLAGS_MACOSX=-I/opt/local/include
|
|
|
|
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
CFLAGS+=$(CFLAGS_MACOSX)
|
|
|
|
LDFLAGS+=$(LDFLAGS_MACOSX)
|
|
|
|
endif
|
|
|
|
|
2018-04-06 12:25:26 +00:00
|
|
|
RK6502LIB=../src/librk65c02.a
|
|
|
|
VASM=vasm6502_std
|
2019-01-04 23:30:18 +00:00
|
|
|
VASMFLAGS=-Fbin -wdc02
|
2018-04-06 12:25:26 +00:00
|
|
|
|
|
|
|
EXAMPLES=min3
|
|
|
|
EXAMPLES_ROMS:=$(addsuffix .rom,$(basename $(wildcard *.s)))
|
|
|
|
|
|
|
|
all : $(EXAMPLES) $(EXAMPLES_ROMS)
|
|
|
|
|
|
|
|
min3 : min3.o $(RK6502LIB)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(RK6502LIB)
|
|
|
|
|
|
|
|
%.rom : %.s
|
|
|
|
$(VASM) $(VASMFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
%.o : %.c
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
clean :
|
|
|
|
rm -f *.o
|
|
|
|
rm -f $(EXAMPLES) $(EXAMPLES_ROMS)
|
|
|
|
|