]> git.sur5r.net Git - cc65/blobdiff - libsrc/Makefile
use first free IOCB for "GRAPHICS 0" call instead of using a hard-coded one
[cc65] / libsrc / Makefile
index ea486499437c5d85aba74d50c0f524baf4e476ad..d855d15807fb59febe0a91600223405a9c93d647 100644 (file)
@@ -10,14 +10,17 @@ CBMS = c128   \
 GEOS = geos-apple \
        geos-cbm
 
-TARGETS = $(CBMS)   \
-          $(GEOS)   \
-          apple2    \
+TARGETS = apple2    \
           apple2enh \
           atari     \
+          atarixl   \
           atmos     \
+          $(CBMS)   \
+          $(GEOS)   \
           lynx      \
           nes       \
+          sim6502   \
+          sim65c02  \
           supervision
 
 DRVTYPES = emd \
@@ -60,11 +63,12 @@ mostlyclean:
        $(call RMDIR,../wrk)
 
 clean:
-       $(call RMDIR,../wrk ../lib $(addprefix ../,$(DRVTYPES)))
+       $(call RMDIR,../wrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
 
 else # TARGET
 
-CFLAGS += -Osir
+CA65FLAGS =
+CC65FLAGS = -Osir -W error
 
 EXTZP = cbm510 \
         cbm610 \
@@ -91,9 +95,15 @@ GEOSDIRS = common      \
            system
 
 ifeq ($(TARGET),apple2enh)
+  SRCDIR = apple2
   OBJPFX = a2
   DRVPFX = a2e
-  SRCDIR = apple2
+else ifeq ($(TARGET),atarixl)
+  SRCDIR = atari
+  OBJPFX = atr
+  DRVPFX = atrx
+else ifeq ($(TARGET),sim65c02)
+  SRCDIR = sim6502
 else
   SRCDIR = $(TARGET)
 endif
@@ -169,7 +179,7 @@ $$($1_OBJS): | $$($1_OBJDIR)
 
 $$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
        @echo $$(TARGET) - $$(@F)
-       @$$(LD) -o $$@ -t module $$^
+       @$$(LD65) -o $$@ -t module $$^
 
 $$($1_OBJDIR) $$($1_DRVDIR):
        @$$(call MKDIR,$$@)
@@ -178,8 +188,8 @@ $(TARGET): $$($1_DRVS)
 
 $$($1_STCPAT): $$($1_DRVPAT)
        @echo $$(TARGET) - $$(<F)
-       @$$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
-       @$$(CA) -t $$(TARGET) -o $$@ $$(@:.o=.s)
+       @$$(CO65) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
+       @$$(CA65) -t $$(TARGET) -o $$@ $$(@:.o=.s)
 
 OBJS += $$($1_STCS)
 
@@ -191,18 +201,20 @@ endef
 
 $(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
 
-AR = $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
-CA = $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
-CC = $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
-CO = $(if $(wildcard ../bin/co65*),../bin/co65,co65)
-LD = $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
+AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
+CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
+CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
+CO65 := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
+LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
+
+export CC65_HOME := $(abspath ..)
 
 ##########
 
 define ASSEMBLE_recipe
 
-@echo $(TARGET) - $<
-@$(CA) -t $(TARGET) $(AFLAGS) --create-dep $(@:.o=.d) -o $@ $<
+$(if $(TRAVIS),,@echo $(TARGET) - $<)
+@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
 
 endef
 
@@ -210,9 +222,9 @@ endef
 
 define COMPILE_recipe
 
-@echo $(TARGET) - $<
-@$(CC) -t $(TARGET) $(CFLAGS) --create-dep $(@:.o=.d) -o $(@:.o=.s) $<
-@$(CA) -t $(TARGET) -o $@ $(@:.o=.s)
+$(if $(TRAVIS),,@echo $(TARGET) - $<)
+@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
+@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
 
 endef
 
@@ -225,11 +237,11 @@ endef
        $(COMPILE_recipe)
 
 $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
-       @echo $(TARGET) - $<
-       @$(CA) -t $(TARGET) $(AFLAGS) -o $@ $<
+       @echo $(TARGET) - $(@F)
+       @$(CA65) -t $(TARGET) $(CA65FLAGS) -o $@ $<
 
 ../lib/$(TARGET).lib: $(OBJS) | ../lib
-       $(AR) a $@ $?
+       $(AR65) a $@ $?
 
 ../wrk/$(TARGET) ../lib ../targetutil:
        @$(call MKDIR,$@)