Moved from VS2013 to MinGW(-w64).
This commit is contained in:
parent
3f0af9b241
commit
30125afcc1
5 changed files with 110 additions and 102 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,6 +3,7 @@
|
||||||
/html/
|
/html/
|
||||||
/joy/
|
/joy/
|
||||||
/lib/
|
/lib/
|
||||||
|
/libwrk/
|
||||||
/mou/
|
/mou/
|
||||||
/ser/
|
/ser/
|
||||||
/targetutil/
|
/targetutil/
|
||||||
|
|
|
@ -4,7 +4,7 @@ install:
|
||||||
- sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686
|
- sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686
|
||||||
script:
|
script:
|
||||||
- make all doc
|
- make all doc
|
||||||
- make -C src clean all CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar PROGEXT=.exe
|
- make -C src clean all CROSS_COMPILE=i686-w64-mingw32-
|
||||||
after_success:
|
after_success:
|
||||||
- make -C doc gh-pages
|
- make -C doc gh-pages
|
||||||
env:
|
env:
|
||||||
|
|
26
doc/Makefile
26
doc/Makefile
|
@ -1,8 +1,18 @@
|
||||||
.PHONY: all doc html info gh-pages mostlyclean clean install
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: all mostlyclean clean install doc html info gh-pages
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
ifeq ($(shell echo),)
|
all mostlyclean install:
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
|
||||||
|
clean doc:
|
||||||
|
|
||||||
|
else # CMD_EXE
|
||||||
|
|
||||||
SGMLS := $(wildcard *.sgml)
|
SGMLS := $(wildcard *.sgml)
|
||||||
|
|
||||||
|
@ -13,7 +23,8 @@ TOC_LEVEL = 2
|
||||||
|
|
||||||
GH_PAGES = ../../gh-pages
|
GH_PAGES = ../../gh-pages
|
||||||
|
|
||||||
all mostlyclean install:
|
clean:
|
||||||
|
$(RM) -r ../html ../info
|
||||||
|
|
||||||
doc: html info
|
doc: html info
|
||||||
|
|
||||||
|
@ -21,9 +32,6 @@ html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png)
|
||||||
|
|
||||||
info: $(addprefix ../info/,$(SGMLS:.sgml=.info))
|
info: $(addprefix ../info/,$(SGMLS:.sgml=.info))
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) -r ../html ../info
|
|
||||||
|
|
||||||
../html ../info:
|
../html ../info:
|
||||||
@mkdir $@
|
@mkdir $@
|
||||||
|
|
||||||
|
@ -50,8 +58,4 @@ ifdef GH_TOKEN
|
||||||
git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git push
|
git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git push
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else # cmd.exe
|
endif # CMD_EXE
|
||||||
|
|
||||||
all doc mostlyclean clean install:
|
|
||||||
|
|
||||||
endif # cmd.exe
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: all mostlyclean clean install lib $(TARGETS)
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
CBMS = c128 \
|
CBMS = c128 \
|
||||||
c16 \
|
c16 \
|
||||||
c64 \
|
c64 \
|
||||||
|
@ -29,6 +37,15 @@ DRVTYPES = emd \
|
||||||
ser \
|
ser \
|
||||||
tgi
|
tgi
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
|
||||||
|
MKDIR = mkdir $(subst /,\,$1)
|
||||||
|
RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
|
||||||
|
else
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
RMDIR = $(RM) -r $1
|
||||||
|
endif
|
||||||
|
|
||||||
# Every target requires its individual vpath setting but the vpath directive
|
# Every target requires its individual vpath setting but the vpath directive
|
||||||
# acts globally. Therefore each target is built in a separate make instance.
|
# acts globally. Therefore each target is built in a separate make instance.
|
||||||
|
|
||||||
|
@ -38,45 +55,29 @@ ifeq ($(words $(MAKECMDGOALS)),1)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
|
|
||||||
|
|
||||||
ifeq ($(shell echo),)
|
|
||||||
MKDIR = mkdir -p $1
|
|
||||||
RMDIR = $(RM) -r $1
|
|
||||||
else
|
|
||||||
MKDIR = mkdir $(subst /,\,$1)
|
|
||||||
RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
|
|
||||||
endif
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
|
|
||||||
.PHONY: all lib $(TARGETS) mostlyclean clean install
|
|
||||||
|
|
||||||
ifndef TARGET
|
ifndef TARGET
|
||||||
|
|
||||||
datadir = $(prefix)/share/cc65
|
datadir = $(prefix)/share/cc65
|
||||||
|
|
||||||
INSTALLDIRS = ../asminc ../cfg ../include \
|
|
||||||
$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)) \
|
|
||||||
../lib ../targetutil $(addprefix ../,$(DRVTYPES))
|
|
||||||
|
|
||||||
INSTALL = install
|
|
||||||
|
|
||||||
all lib: $(TARGETS)
|
all lib: $(TARGETS)
|
||||||
|
|
||||||
$(TARGETS):
|
|
||||||
@$(MAKE) --no-print-directory $@
|
|
||||||
|
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
$(call RMDIR,../libwrk)
|
$(call RMDIR,../libwrk)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
|
$(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
|
||||||
|
|
||||||
install:
|
ifdef CMD_EXE
|
||||||
$(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
|
|
||||||
|
|
||||||
##########
|
install:
|
||||||
|
|
||||||
|
else # CMD_EXE
|
||||||
|
|
||||||
|
INSTALL = install
|
||||||
|
|
||||||
|
INSTALLDIRS = ../asminc ../cfg ../include \
|
||||||
|
$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)) \
|
||||||
|
../lib ../targetutil $(addprefix ../,$(DRVTYPES))
|
||||||
|
|
||||||
define INSTALL_recipe
|
define INSTALL_recipe
|
||||||
|
|
||||||
|
@ -84,9 +85,15 @@ $(if $(prefix),,$(error variable `prefix' must be set))
|
||||||
$(INSTALL) -d $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
$(INSTALL) -d $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
||||||
$(INSTALL) -m644 $(dir)/*.* $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
$(INSTALL) -m644 $(dir)/*.* $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
||||||
|
|
||||||
endef
|
endef # INSTALL_recipe
|
||||||
|
|
||||||
##########
|
install:
|
||||||
|
$(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
|
||||||
|
|
||||||
|
endif # CMD_EXE
|
||||||
|
|
||||||
|
$(TARGETS):
|
||||||
|
@$(MAKE) --no-print-directory $@
|
||||||
|
|
||||||
else # TARGET
|
else # TARGET
|
||||||
|
|
||||||
|
@ -183,8 +190,6 @@ ifeq ($(TARGET),$(filter $(TARGET),$(TARGETUTIL)))
|
||||||
include $(SRCDIR)/targetutil/Makefile.inc
|
include $(SRCDIR)/targetutil/Makefile.inc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define DRVTYPE_template
|
define DRVTYPE_template
|
||||||
|
|
||||||
$1_SRCDIR = $$(SRCDIR)/$1
|
$1_SRCDIR = $$(SRCDIR)/$1
|
||||||
|
@ -221,9 +226,7 @@ OBJS += $$($1_STCS)
|
||||||
|
|
||||||
DEPS += $$($1_OBJS:.o=.d)
|
DEPS += $$($1_OBJS:.o=.d)
|
||||||
|
|
||||||
endef
|
endef # DRVTYPE_template
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
|
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
|
||||||
|
|
||||||
|
@ -235,16 +238,12 @@ LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
|
||||||
|
|
||||||
export CC65_HOME := $(abspath ..)
|
export CC65_HOME := $(abspath ..)
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define ASSEMBLE_recipe
|
define ASSEMBLE_recipe
|
||||||
|
|
||||||
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
||||||
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
|
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
|
||||||
|
|
||||||
endef
|
endef # ASSEMBLE_recipe
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define COMPILE_recipe
|
define COMPILE_recipe
|
||||||
|
|
||||||
|
@ -252,9 +251,7 @@ $(if $(TRAVIS),,@echo $(TARGET) - $<)
|
||||||
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
|
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
|
||||||
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
|
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
|
||||||
|
|
||||||
endef
|
endef # COMPILE_recipe
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
../libwrk/$(TARGET)/%.o: %.s | ../libwrk/$(TARGET)
|
../libwrk/$(TARGET)/%.o: %.s | ../libwrk/$(TARGET)
|
||||||
$(ASSEMBLE_recipe)
|
$(ASSEMBLE_recipe)
|
||||||
|
|
104
src/Makefile
104
src/Makefile
|
@ -1,9 +1,11 @@
|
||||||
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: all mostlyclean clean install avail unavail bin $(PROGS)
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
.PHONY: all bin $(PROGS) mostlyclean clean install avail unavail
|
|
||||||
|
|
||||||
ifeq ($(shell echo),)
|
|
||||||
|
|
||||||
PROGS = ar65 \
|
PROGS = ar65 \
|
||||||
ca65 \
|
ca65 \
|
||||||
cc65 \
|
cc65 \
|
||||||
|
@ -25,6 +27,9 @@ LD65_LIB = $(datadir)/lib
|
||||||
LD65_OBJ = $(datadir)/lib
|
LD65_OBJ = $(datadir)/lib
|
||||||
LD65_CFG = $(datadir)/cfg
|
LD65_CFG = $(datadir)/cfg
|
||||||
|
|
||||||
|
CC = $(CROSS_COMPILE)gcc
|
||||||
|
AR = $(CROSS_COMPILE)ar
|
||||||
|
|
||||||
CFLAGS += -MMD -MP -O -I common $(USER_CFLAGS) \
|
CFLAGS += -MMD -MP -O -I common $(USER_CFLAGS) \
|
||||||
-Wall -Wextra -Wno-char-subscripts \
|
-Wall -Wextra -Wno-char-subscripts \
|
||||||
-DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
|
-DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
|
||||||
|
@ -34,15 +39,50 @@ CFLAGS += $(if $(TRAVIS),-Werror)
|
||||||
|
|
||||||
LDLIBS += -lm
|
LDLIBS += -lm
|
||||||
|
|
||||||
INSTALL = install
|
ifdef CMD_EXE
|
||||||
|
EXE_SUFFIX=.exe
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CROSS_COMPILE
|
||||||
|
EXE_SUFFIX=.exe
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
|
||||||
|
MKDIR = mkdir $(subst /,\,$1)
|
||||||
|
RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
|
||||||
|
else
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
RMDIR = $(RM) -r $1
|
||||||
|
endif
|
||||||
|
|
||||||
all bin: $(PROGS)
|
all bin: $(PROGS)
|
||||||
|
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
$(RM) -r ../wrk
|
$(call RMDIR,../wrk)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r ../wrk ../bin
|
$(call RMDIR,../wrk ../bin)
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
|
||||||
|
install avail unavail:
|
||||||
|
|
||||||
|
else # CMD_EXE
|
||||||
|
|
||||||
|
INSTALL = install
|
||||||
|
|
||||||
|
define AVAIL_recipe
|
||||||
|
|
||||||
|
ln -s $(abspath ../bin/$(prog)) /usr/local/bin/$(prog)
|
||||||
|
|
||||||
|
endef # AVAIL_recipe
|
||||||
|
|
||||||
|
define UNAVAIL_recipe
|
||||||
|
|
||||||
|
$(RM) /usr/local/bin/$(prog)
|
||||||
|
|
||||||
|
endef # UNAVAIL_recipe
|
||||||
|
|
||||||
install:
|
install:
|
||||||
$(if $(prefix),,$(error variable `prefix' must be set))
|
$(if $(prefix),,$(error variable `prefix' must be set))
|
||||||
|
@ -55,23 +95,7 @@ avail:
|
||||||
unavail:
|
unavail:
|
||||||
$(foreach prog,$(PROGS),$(UNAVAIL_recipe))
|
$(foreach prog,$(PROGS),$(UNAVAIL_recipe))
|
||||||
|
|
||||||
##########
|
endif # CMD_EXE
|
||||||
|
|
||||||
define AVAIL_recipe
|
|
||||||
|
|
||||||
ln -s $(abspath ../bin/$(prog)) /usr/local/bin/$(prog)
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define UNAVAIL_recipe
|
|
||||||
|
|
||||||
$(RM) /usr/local/bin/$(prog)
|
|
||||||
|
|
||||||
endef
|
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define OBJS_template
|
define OBJS_template
|
||||||
|
|
||||||
|
@ -80,53 +104,35 @@ $1_OBJS := $$(patsubst %.c,../wrk/%.o,$$(wildcard $1/*.c))
|
||||||
$$($1_OBJS): | ../wrk/$1
|
$$($1_OBJS): | ../wrk/$1
|
||||||
|
|
||||||
../wrk/$1:
|
../wrk/$1:
|
||||||
@mkdir -p $$@
|
@$$(call MKDIR,$$@)
|
||||||
|
|
||||||
DEPS += $$($1_OBJS:.o=.d)
|
DEPS += $$($1_OBJS:.o=.d)
|
||||||
|
|
||||||
endef
|
endef # OBJS_template
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
define PROG_template
|
define PROG_template
|
||||||
|
|
||||||
$$(eval $$(call OBJS_template,$1))
|
$$(eval $$(call OBJS_template,$1))
|
||||||
|
|
||||||
../bin/$1$(PROGEXT): $$($1_OBJS) ../wrk/common/common.a | ../bin
|
../bin/$1$(EXE_SUFFIX): $$($1_OBJS) ../wrk/common/common.a | ../bin
|
||||||
$$(CC) $$(LDFLAGS) -o $$@ $$^ $$(LDLIBS)
|
$$(CC) $$(LDFLAGS) -o $$@ $$^ $$(LDLIBS)
|
||||||
|
|
||||||
$1: ../bin/$1$(PROGEXT)
|
$1: ../bin/$1$(EXE_SUFFIX)
|
||||||
|
|
||||||
endef
|
endef # PROG_template
|
||||||
|
|
||||||
##########
|
|
||||||
|
|
||||||
../wrk/%.o: %.c
|
../wrk/%.o: %.c
|
||||||
@echo $<
|
@echo $<
|
||||||
@$(CC) -c $(CFLAGS) -o $@ $<
|
@$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
../bin:
|
../bin:
|
||||||
@mkdir $@
|
@$(call MKDIR,$@)
|
||||||
|
|
||||||
$(eval $(call OBJS_template,common))
|
$(eval $(call OBJS_template,common))
|
||||||
|
|
||||||
../wrk/common/common.a: $(common_OBJS)
|
../wrk/common/common.a: $(common_OBJS)
|
||||||
$(AR) r $@ $?
|
$(AR) r $@ $?
|
||||||
|
|
||||||
$(foreach prog,$(PROGS),$(eval $(call PROG_template,$(prog))))
|
$(foreach prog,$(PROGS),$(eval $(call PROG_template,$(prog))))
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
else # cmd.exe
|
|
||||||
|
|
||||||
all bin:
|
|
||||||
msbuild cc65.sln /p:configuration=release /consoleloggerparameters:disableconsolecolor
|
|
||||||
|
|
||||||
mostlyclean:
|
|
||||||
$(if $(wildcard ../wrk),rmdir /s /q ..\wrk)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
msbuild cc65.sln /p:configuration=release /consoleloggerparameters:disableconsolecolor /target:$@
|
|
||||||
|
|
||||||
install avail unavail:
|
|
||||||
|
|
||||||
endif # cmd.exe
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue