mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +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
|
||||
endif
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Lists of subdirectories
|
||||
|
||||
DIRLIST = tutorial
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Lists of executables
|
||||
|
||||
@ -209,10 +214,17 @@ ifndef EXELIST_$(SYS)
|
||||
EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)}
|
||||
endif
|
||||
|
||||
define SUBDIR_recipe
|
||||
|
||||
@$(MAKE) -C $(dir) --no-print-directory $@
|
||||
|
||||
endef # SUBDIR_recipe
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Rules to make the binaries and the disk
|
||||
|
||||
samples: $(EXELIST_$(SYS))
|
||||
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
||||
|
||||
disk: $(DISK_$(SYS))
|
||||
|
||||
@ -338,3 +350,4 @@ mostlyclean:
|
||||
clean: mostlyclean
|
||||
@$(DEL) $(EXELIST_$(SYS)) $(DISK_$(SYS)) 2>$(NULLDEV)
|
||||
@$(DEL) multdemo.? ovrldemo.? 2>$(NULLDEV)
|
||||
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
||||
|
@ -25,16 +25,16 @@ ifdef CC65_HOME
|
||||
CL = $(CC65_HOME)/bin/cl65
|
||||
LD = $(CC65_HOME)/bin/ld65
|
||||
else
|
||||
AS := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
|
||||
CC := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
|
||||
CL := $(if $(wildcard ../bin/cl65*),../bin/cl65,cl65)
|
||||
LD := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
|
||||
AS := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65)
|
||||
CC := $(if $(wildcard ../../bin/cc65*),../../bin/cc65,cc65)
|
||||
CL := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
|
||||
LD := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65)
|
||||
endif
|
||||
|
||||
all: hello
|
||||
samples: hello
|
||||
|
||||
hello: hello.c text.s
|
||||
$(CL) -t $(SYS) -o hello hello.c text.s
|
||||
|
||||
clean:
|
||||
$(RM) hello
|
||||
@$(DEL) hello 2>$(NULLDEV)
|
||||
|
Loading…
Reference in New Issue
Block a user