mirror of
https://github.com/cc65/cc65.git
synced 2024-09-30 08:57:49 +00:00
- Added support for calling subdir Makefiles for the make targets 'samples' and 'clean'.
- Adjusted the 'tutorial' Makefile to actually work as expected. Note: The 'disasm' and 'geos' Makefiles don't seem to work so they are not called as of now.
This commit is contained in:
parent
b931e65811
commit
fd208fdf0b
@ -150,6 +150,11 @@ else
|
|||||||
$(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -m $@.map $^ $(SYS).lib
|
$(LD) $(LDFLAGS_$(@F)_$(SYS)) $(LDFLAGS) -o $@ -t $(SYS) -m $@.map $^ $(SYS).lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# Lists of subdirectories
|
||||||
|
|
||||||
|
DIRLIST = tutorial
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Lists of executables
|
# Lists of executables
|
||||||
|
|
||||||
@ -209,10 +214,17 @@ ifndef EXELIST_$(SYS)
|
|||||||
EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)}
|
EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
define SUBDIR_recipe
|
||||||
|
|
||||||
|
@$(MAKE) -C $(dir) --no-print-directory $@
|
||||||
|
|
||||||
|
endef # SUBDIR_recipe
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Rules to make the binaries and the disk
|
# Rules to make the binaries and the disk
|
||||||
|
|
||||||
samples: $(EXELIST_$(SYS))
|
samples: $(EXELIST_$(SYS))
|
||||||
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
||||||
|
|
||||||
disk: $(DISK_$(SYS))
|
disk: $(DISK_$(SYS))
|
||||||
|
|
||||||
@ -338,3 +350,4 @@ mostlyclean:
|
|||||||
clean: mostlyclean
|
clean: mostlyclean
|
||||||
@$(DEL) $(EXELIST_$(SYS)) $(DISK_$(SYS)) 2>$(NULLDEV)
|
@$(DEL) $(EXELIST_$(SYS)) $(DISK_$(SYS)) 2>$(NULLDEV)
|
||||||
@$(DEL) multdemo.? ovrldemo.? 2>$(NULLDEV)
|
@$(DEL) multdemo.? ovrldemo.? 2>$(NULLDEV)
|
||||||
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
||||||
|
@ -25,16 +25,16 @@ ifdef CC65_HOME
|
|||||||
CL = $(CC65_HOME)/bin/cl65
|
CL = $(CC65_HOME)/bin/cl65
|
||||||
LD = $(CC65_HOME)/bin/ld65
|
LD = $(CC65_HOME)/bin/ld65
|
||||||
else
|
else
|
||||||
AS := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
|
AS := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65)
|
||||||
CC := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
|
CC := $(if $(wildcard ../../bin/cc65*),../../bin/cc65,cc65)
|
||||||
CL := $(if $(wildcard ../bin/cl65*),../bin/cl65,cl65)
|
CL := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
|
||||||
LD := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
|
LD := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: hello
|
samples: hello
|
||||||
|
|
||||||
hello: hello.c text.s
|
hello: hello.c text.s
|
||||||
$(CL) -t $(SYS) -o hello hello.c text.s
|
$(CL) -t $(SYS) -o hello hello.c text.s
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) hello
|
@$(DEL) hello 2>$(NULLDEV)
|
||||||
|
Loading…
Reference in New Issue
Block a user