|
1 | | -# Generic Build script for CC65 |
| 1 | +# generic c/asm build script. |
2 | 2 | # |
3 | | - |
4 | | -# Customized for fujinet-libs |
| 3 | +# This makefile is responsible for compiling the asm/s/c files for a particular target, passed in as CURRENT_TARGET |
| 4 | +# |
| 5 | +# You should not normally need to update this file unless you are making enhancements or bug fixes to it. |
| 6 | +# For compiling the library, it does not need changes for simple additions of new files etc. |
| 7 | +# |
| 8 | +# It will RECURSIVELY add to the sources to be built everything that isunder the folders |
| 9 | +# - <CURRENT_TARGET>/src/*.[c,<s|asm>] |
| 10 | +# - common/src/*.[c,<s|asm>] |
| 11 | +# - <CURRENT_TARGET>/<platform specific path>/ |
| 12 | +# |
| 13 | +# This means that the makefile does not have to be updated to add new folders, or if you restructure your code. |
| 14 | +# |
| 15 | +# Platform specific paths are defined in os.mk, and allow a particular target within a platform (e.g. apple2gs) to |
| 16 | +# add its own folders that are not included for other targets of that platform. |
| 17 | +# e.g. for apple2 and apple2enh it includes "apple2/apple2-6502", whereas the apple2gs target adds "apple2/apple2gs" |
| 18 | +# |
| 19 | +# code is compiled into the obj/ folder including the full paths of the src file to ensure similarly named files |
| 20 | +# from different folders do not clash |
5 | 21 |
|
6 | 22 | # Ensure WSL2 Ubuntu and other linuxes use bash by default instead of /bin/sh, which does not always like the shell commands. |
7 | 23 | SHELL := /usr/bin/env bash |
@@ -85,36 +101,17 @@ OBJECTS_ARC := $(strip $(OBJECTS_ARC)) |
85 | 101 | # Ensure make recompiles parts it needs to if src files change |
86 | 102 | DEPENDS := $(OBJECTS:$(OBJEXT)=.d) |
87 | 103 |
|
88 | | -ifeq ($(CC),iix compile) |
89 | | -CFLAGS += \ |
90 | | - $(INCC_ARG)common/inc \ |
91 | | - $(INCC_ARG)$(PLATFORM_SRC_DIR)/include \ |
92 | | - $(INCC_ARG). |
93 | | -else ifeq ($(CC),zcc) |
94 | 104 | CFLAGS += \ |
95 | 105 | $(INCC_ARG)common/inc \ |
96 | 106 | $(INCC_ARG)$(PLATFORM_SRC_DIR)/include \ |
97 | 107 | $(INCC_ARG). |
98 | 108 |
|
| 109 | +# only include ASFLAGS if not wcc or iix |
| 110 | +ifneq ($(filter $(CC),wcc iix),$(CC)) |
99 | 111 | ASFLAGS += \ |
100 | 112 | $(INCS_ARG)common/inc \ |
101 | 113 | $(INCS_ARG)$(PLATFORM_SRC_DIR)/include \ |
102 | 114 | $(INCS_ARG). |
103 | | -else ifeq ($(CC),wcc) |
104 | | -CFLAGS += \ |
105 | | - $(INCC_ARG)common/inc \ |
106 | | - $(INCC_ARG)$(PLATFORM_SRC_DIR)/include \ |
107 | | - $(INCC_ARG). |
108 | | -else |
109 | | -ASFLAGS += \ |
110 | | - $(INCS_ARG) common/inc \ |
111 | | - $(INCS_ARG) $(PLATFORM_SRC_DIR)/include \ |
112 | | - $(INCS_ARG) . |
113 | | - |
114 | | -CFLAGS += \ |
115 | | - $(INCC_ARG) common/inc \ |
116 | | - $(INCC_ARG) $(PLATFORM_SRC_DIR)/include \ |
117 | | - $(INCC_ARG) . |
118 | 115 | endif |
119 | 116 |
|
120 | 117 | FN_NW_HEADER = fujinet-network.h |
@@ -192,14 +189,6 @@ else |
192 | 189 | $(CC) -c --deps $(CFLAGS) -o $@ $< |
193 | 190 | endif |
194 | 191 |
|
195 | | -## For now, no asm in common dirs... as it would be compiler specific |
196 | | -# $(OBJDIR)/$(CURRENT_TARGET)/common/%$(OBJEXT): %$(ASMEXT) | $(TARGETOBJDIR) |
197 | | -# @$(call MKDIR,$(dir $@)) |
198 | | -# ifeq ($(CC),cl65) |
199 | | -# $(CC) -t $(CURRENT_TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $< |
200 | | -# else |
201 | | -# endif |
202 | | - |
203 | 192 | # below shell part is a hack to make foo.ROOT become foo.root, even though the output name is already foo.root, iix capitalizes the "ROOT" part in the filename, which breaks the linux version of linker |
204 | 193 | $(OBJDIR)/$(CURRENT_TARGET)/%$(OBJEXT): %$(ASMEXT) $(VERSION_FILE) | $(OBJDIR) |
205 | 194 | @$(call MKDIR,$(dir $@)) |
|
0 commit comments