Skip to content

Commit 531a8d8

Browse files
committed
Initial commit
1 parent 2d0a82a commit 531a8d8

File tree

164 files changed

+12184
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+12184
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
TARGETS := $(strip $(shell ls -d _target*))
2+
ifeq ($(TARGETS),)
3+
$(error There are no targets to clean/build)
4+
endif
5+
MAKE_PREFIX = make_
6+
CLEAN_PREFIX = clean_
7+
MAKE_TARGETS := $(foreach dir,$(TARGETS),$(MAKE_PREFIX)$(dir))
8+
CLEAN_TARGETS := $(foreach dir,$(TARGETS),$(CLEAN_PREFIX)$(dir))
9+
10+
all: $(MAKE_TARGETS)
11+
12+
$(MAKE_TARGETS):
13+
$(MAKE) -C ./$(subst $(MAKE_PREFIX),,$@) all
14+
15+
clean: $(CLEAN_TARGETS)
16+
17+
$(CLEAN_TARGETS):
18+
$(MAKE) -C ./$(subst $(CLEAN_PREFIX),,$@) clean

_target_sdcc_nrf24le1_24/Makefile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
###############################################
2+
### Begin user-specific portion of Makefile ###
3+
###############################################
4+
5+
# Add directories here that appear under the <top level>/src folder that should not be compiled
6+
SUBSRCDIRSTOFILTER =
7+
8+
# If the build target name is non-standard, enter the standard build target found in libraries here to override.
9+
# Leave this blank if this build target has a standard name.
10+
EXTERNALTARGETNAME =
11+
12+
# If the source code requires a minimum version of a compiler build, then enter it here. This value must be an integer!
13+
# Leave this blank if the source can be built with any compiler version.
14+
export MINCOMPILERBUILD =
15+
16+
#############################################
17+
### End user-specific portion of Makefile ###
18+
#############################################
19+
20+
# Functions needed by this makefile and the one that builds the source libraries (MakefileSrc)
21+
export ECHO = @echo
22+
export RM = rm
23+
export SED = sed
24+
export MKDIR = mkdir
25+
export TR = tr
26+
export BLACKHOLE = /dev/null
27+
export PWD = pwd
28+
export CD = cd
29+
export LS = ls
30+
31+
# Name for this build target
32+
export TARGETNAME := $(shell $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__')
33+
34+
# Name for external build target
35+
ifeq ($(EXTERNALTARGETNAME),)
36+
EXTERNALTARGETNAMELCL = $(TARGETNAME)
37+
else
38+
EXTERNALTARGETNAMELCL = $(EXTERNALTARGETNAME)
39+
endif
40+
41+
# Directories related to the library and location of the local source tree
42+
TOPLEVELREL = ..
43+
LIBNAME := $(shell $(CD) .. && $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__' && $(CD) $(TARGETNAME))
44+
TARGETTOSRCDIRREL = $(TOPLEVELREL)/src
45+
SRCTOTARGETDIRREL = ../$(TARGETNAME)
46+
LOCALSRCRELTOTARGET = ../../$(TARGETNAME)
47+
48+
# Include directories (outside this folder) that the sub makes need to know about
49+
EXTERNLIBS = $(filter-out $(LIBNAME),$(filter lib_%,$(subst /.,,$(strip $(shell $(CD) ../.. && $(LS) -d */. && $(CD) $(LIBNAME)/$(TARGETNAME))))))
50+
export EXTERNINCDIRS = $(foreach dir,$(EXTERNLIBS),../../$(dir)/include ../../$(dir)/$(EXTERNALTARGETNAMELCL)/include)
51+
52+
# Directories related to the build process of the target
53+
export TARGETDIR = $(TARGETNAME)
54+
export TARGETLIBDIRREL = lib
55+
export TARGETOBJDIRREL = obj
56+
export TARGETDEPDIRREL = dep
57+
export TARGETSRCMAKEFILE = $(LOCALSRCRELTOTARGET)/MakefileSrc
58+
export TARGETRELTOSUBSRCREL = ../../$(TARGETNAME)
59+
60+
# Directories inside the local source tree
61+
SUBSRCDIRSRAW := $(subst /.,,$(strip $(shell $(CD) $(TARGETTOSRCDIRREL) && $(LS) -d */. && $(CD) $(SRCTOTARGETDIRREL))))
62+
ifeq ($(SUBSRCDIRSRAW),)
63+
$(error There are no source directories to clean/build)
64+
endif
65+
SUBSRCDIRSRAWFILT := $(filter-out $(SUBSRCDIRSTOFILTER),$(SUBSRCDIRSRAW))
66+
ifeq ($(SUBSRCDIRSRAWFILT),)
67+
$(error There are available source directories to clean/build, but they have been filtered out by SUBSRCDIRSTOFILTER)
68+
endif
69+
SUBSRCDIRS := $(foreach dir,$(SUBSRCDIRSRAWFILT),$(TARGETTOSRCDIRREL)/$(dir))
70+
71+
72+
all:
73+
$(ECHO)
74+
$(ECHO) "Building target '$(TARGETNAME)' for library collection '$(LIBNAME)'"
75+
@$(MAKE) $(SUBSRCDIRS)
76+
$(ECHO)
77+
$(ECHO) "Finished building target '$(TARGETNAME)' for library collection '$(LIBNAME)'"
78+
79+
$(SUBSRCDIRS):
80+
$(ECHO)
81+
$(ECHO) "Building library '$(@F)'"
82+
$(MAKE) -C $@ all
83+
$(ECHO) "Finished building library '$(@F)'"
84+
85+
clean:
86+
$(ECHO)
87+
$(ECHO) "Cleaning target '$(TARGETNAME)' for library '$(LIBNAME)'"
88+
$(if $(TARGETLIBDIRREL),$(RM) -rf $(TARGETLIBDIRREL)/*)
89+
$(if $(TARGETOBJDIRREL),$(RM) -rf $(TARGETOBJDIRREL)/*)
90+
$(if $(TARGETDEPDIRREL),$(RM) -rf $(TARGETDEPDIRREL)/*)
91+
$(ECHO) "Finished cleaning target '$(TARGETNAME)' for library '$(LIBNAME)'"
92+
93+
.PHONY: $(SUBSRCDIRS)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Programs to use for creating dependencies, compiling source files, and creating the library file, respectively
2+
DEP = sdcc
3+
CC = sdcc
4+
LIB = sdcclib
5+
6+
# Flags for above programs when calling them from the command line
7+
DFLAGS = -MM $(INCDIRS) $<
8+
CFLAGS = --model-large --std-c99 $(INCDIRS) -c $< -o "$(OBJDIR)/"
9+
LFLAGS =
10+
11+
# File extensions for dependency files, source files, object files, and library files, respectively
12+
DEPEXT = d
13+
SRCEXT = c
14+
OBJEXT = rel
15+
LIBEXT = lib
16+
17+
# Compiler version
18+
ifneq ($(MINCOMPILERBUILD),)
19+
CCVERSION := $(subst \#,,$(filter \#%,$(strip $(shell $(CC) -v))))
20+
CCVERSIONOK := $(shell [ $(CCVERSION) -ge $(MINCOMPILERBUILD) ] && echo "YES" || echo "NO")
21+
ifeq ($(CCVERSIONOK),NO)
22+
$(error "The build has detected an SDCC build of #$(CCVERSION). This library must be built by an SDCC build of at least #$(MINCOMPILERBUILD). Please update your SDCC installation.")
23+
endif
24+
endif
25+
26+
# Target directory
27+
TARGETDIR = $(TARGETRELTOSUBSRCREL)
28+
29+
# Source dir name, include directories, and sub source dir
30+
NAME := $(shell $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__')
31+
INCDIRS = -I../../include -I$(TARGETDIR)/include $(foreach dir,$(strip $(EXTERNINCDIRS)),-I../$(dir))
32+
LCLSRCDIR = src
33+
34+
# Directories for objects, dependencies, and library files
35+
OBJDIR = $(TARGETDIR)/$(TARGETOBJDIRREL)/$(NAME)
36+
DEPDIR = $(TARGETDIR)/$(TARGETDEPDIRREL)/$(NAME)
37+
LIBDIR = $(TARGETDIR)/$(TARGETLIBDIRREL)
38+
39+
# Name of library file, list of source files, object files, and dependency files
40+
LIBFILE = $(LIBDIR)/$(NAME).$(LIBEXT)
41+
SRCFILES := $(shell $(LS) $(LCLSRCDIR)/*.$(SRCEXT))
42+
OBJFILES = $(subst .$(SRCEXT),.$(OBJEXT),$(subst $(LCLSRCDIR),$(OBJDIR),$(SRCFILES)))
43+
DEPFILES = $(subst .$(SRCEXT),.$(DEPEXT),$(subst $(LCLSRCDIR),$(DEPDIR),$(SRCFILES)))
44+
45+
# Used to makes sure source files get built if their dependency files are modified
46+
-include $(DEPFILES)
47+
48+
all: build
49+
50+
build: $(LIBFILE)
51+
52+
$(LIBDIR)/%.$(LIBEXT): $(OBJFILES)
53+
$(ECHO)
54+
$(ECHO) "Building library file '$@'"
55+
$(LIB) $(LFLAGS) $@ $(OBJFILES)
56+
$(ECHO) "Finished building library file '$@'"
57+
$(ECHO)
58+
59+
$(OBJDIR)/%.$(OBJEXT) : $(LCLSRCDIR)/%.$(SRCEXT) $(DEPDIR)/%.$(DEPEXT)
60+
$(ECHO)
61+
$(ECHO) "Building object file '$@'"
62+
[ -d $(OBJDIR) ] || $(MKDIR) $(OBJDIR) > $(BLACKHOLE)
63+
$(CC) $(CFLAGS)
64+
$(ECHO) "Finished building object file '$@'"
65+
66+
$(DEPDIR)/%.$(DEPEXT): $(LCLSRCDIR)/%.$(SRCEXT)
67+
$(ECHO)
68+
$(ECHO) "Building dependency file '$@'"
69+
[ -d $(DEPDIR) ] || $(MKDIR) $(DEPDIR) > $(BLACKHOLE)
70+
$(ECHO) "$(OBJDIR)/" | $(TR) -d '\n' | $(TR) -d '\r' > $@.tmp
71+
$(DEP) $(DFLAGS) >> $@.tmp
72+
$(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@
73+
$(RM) -f $@.tmp
74+
$(ECHO) "Finished building dependency file '$@'"
75+
76+
.SECONDARY: $(OBJFILES) $(DEPFILES)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef TARGET_NRF24LE1_SDK_H_
2+
#define TARGET_NRF24LE1_SDK_H_
3+
4+
//DO NOT include reg24le1.h here or a circular include will happen
5+
//This header file is included by reg24le1.h to provide it a package variant
6+
#define __TARG_PACKAGE_TYPE NRF24LE1_PACKAGE_24_PIN
7+
8+
//Encryption/decryption subsystem #defines
9+
#define __TARG_ENC_DEC_ACCEL_ALLOW_INLINING 1 //If non-zero, this allows the enc_dec_accel_galois_multiply() function to be inlined (requires compiler option --std-c99)
10+
11+
#endif /* TARGET_NRF24LE1_SDK_H_ */

_target_sdcc_nrf24le1_32/Makefile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
###############################################
2+
### Begin user-specific portion of Makefile ###
3+
###############################################
4+
5+
# Add directories here that appear under the <top level>/src folder that should not be compiled
6+
SUBSRCDIRSTOFILTER =
7+
8+
# If the build target name is non-standard, enter the standard build target found in libraries here to override.
9+
# Leave this blank if this build target has a standard name.
10+
EXTERNALTARGETNAME =
11+
12+
# If the source code requires a minimum version of a compiler build, then enter it here. This value must be an integer!
13+
# Leave this blank if the source can be built with any compiler version.
14+
export MINCOMPILERBUILD =
15+
16+
#############################################
17+
### End user-specific portion of Makefile ###
18+
#############################################
19+
20+
# Functions needed by this makefile and the one that builds the source libraries (MakefileSrc)
21+
export ECHO = @echo
22+
export RM = rm
23+
export SED = sed
24+
export MKDIR = mkdir
25+
export TR = tr
26+
export BLACKHOLE = /dev/null
27+
export PWD = pwd
28+
export CD = cd
29+
export LS = ls
30+
31+
# Name for this build target
32+
export TARGETNAME := $(shell $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__')
33+
34+
# Name for external build target
35+
ifeq ($(EXTERNALTARGETNAME),)
36+
EXTERNALTARGETNAMELCL = $(TARGETNAME)
37+
else
38+
EXTERNALTARGETNAMELCL = $(EXTERNALTARGETNAME)
39+
endif
40+
41+
# Directories related to the library and location of the local source tree
42+
TOPLEVELREL = ..
43+
LIBNAME := $(shell $(CD) .. && $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__' && $(CD) $(TARGETNAME))
44+
TARGETTOSRCDIRREL = $(TOPLEVELREL)/src
45+
SRCTOTARGETDIRREL = ../$(TARGETNAME)
46+
LOCALSRCRELTOTARGET = ../../$(TARGETNAME)
47+
48+
# Include directories (outside this folder) that the sub makes need to know about
49+
EXTERNLIBS = $(filter-out $(LIBNAME),$(filter lib_%,$(subst /.,,$(strip $(shell $(CD) ../.. && $(LS) -d */. && $(CD) $(LIBNAME)/$(TARGETNAME))))))
50+
export EXTERNINCDIRS = $(foreach dir,$(EXTERNLIBS),../../$(dir)/include ../../$(dir)/$(EXTERNALTARGETNAMELCL)/include)
51+
52+
# Directories related to the build process of the target
53+
export TARGETDIR = $(TARGETNAME)
54+
export TARGETLIBDIRREL = lib
55+
export TARGETOBJDIRREL = obj
56+
export TARGETDEPDIRREL = dep
57+
export TARGETSRCMAKEFILE = $(LOCALSRCRELTOTARGET)/MakefileSrc
58+
export TARGETRELTOSUBSRCREL = ../../$(TARGETNAME)
59+
60+
# Directories inside the local source tree
61+
SUBSRCDIRSRAW := $(subst /.,,$(strip $(shell $(CD) $(TARGETTOSRCDIRREL) && $(LS) -d */. && $(CD) $(SRCTOTARGETDIRREL))))
62+
ifeq ($(SUBSRCDIRSRAW),)
63+
$(error There are no source directories to clean/build)
64+
endif
65+
SUBSRCDIRSRAWFILT := $(filter-out $(SUBSRCDIRSTOFILTER),$(SUBSRCDIRSRAW))
66+
ifeq ($(SUBSRCDIRSRAWFILT),)
67+
$(error There are available source directories to clean/build, but they have been filtered out by SUBSRCDIRSTOFILTER)
68+
endif
69+
SUBSRCDIRS := $(foreach dir,$(SUBSRCDIRSRAWFILT),$(TARGETTOSRCDIRREL)/$(dir))
70+
71+
72+
all:
73+
$(ECHO)
74+
$(ECHO) "Building target '$(TARGETNAME)' for library collection '$(LIBNAME)'"
75+
@$(MAKE) $(SUBSRCDIRS)
76+
$(ECHO)
77+
$(ECHO) "Finished building target '$(TARGETNAME)' for library collection '$(LIBNAME)'"
78+
79+
$(SUBSRCDIRS):
80+
$(ECHO)
81+
$(ECHO) "Building library '$(@F)'"
82+
$(MAKE) -C $@ all
83+
$(ECHO) "Finished building library '$(@F)'"
84+
85+
clean:
86+
$(ECHO)
87+
$(ECHO) "Cleaning target '$(TARGETNAME)' for library '$(LIBNAME)'"
88+
$(if $(TARGETLIBDIRREL),$(RM) -rf $(TARGETLIBDIRREL)/*)
89+
$(if $(TARGETOBJDIRREL),$(RM) -rf $(TARGETOBJDIRREL)/*)
90+
$(if $(TARGETDEPDIRREL),$(RM) -rf $(TARGETDEPDIRREL)/*)
91+
$(ECHO) "Finished cleaning target '$(TARGETNAME)' for library '$(LIBNAME)'"
92+
93+
.PHONY: $(SUBSRCDIRS)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Programs to use for creating dependencies, compiling source files, and creating the library file, respectively
2+
DEP = sdcc
3+
CC = sdcc
4+
LIB = sdcclib
5+
6+
# Flags for above programs when calling them from the command line
7+
DFLAGS = -MM $(INCDIRS) $<
8+
CFLAGS = --model-large --std-c99 $(INCDIRS) -c $< -o "$(OBJDIR)/"
9+
LFLAGS =
10+
11+
# File extensions for dependency files, source files, object files, and library files, respectively
12+
DEPEXT = d
13+
SRCEXT = c
14+
OBJEXT = rel
15+
LIBEXT = lib
16+
17+
# Compiler version
18+
ifneq ($(MINCOMPILERBUILD),)
19+
CCVERSION := $(subst \#,,$(filter \#%,$(strip $(shell $(CC) -v))))
20+
CCVERSIONOK := $(shell [ $(CCVERSION) -ge $(MINCOMPILERBUILD) ] && echo "YES" || echo "NO")
21+
ifeq ($(CCVERSIONOK),NO)
22+
$(error "The build has detected an SDCC build of #$(CCVERSION). This library must be built by an SDCC build of at least #$(MINCOMPILERBUILD). Please update your SDCC installation.")
23+
endif
24+
endif
25+
26+
# Target directory
27+
TARGETDIR = $(TARGETRELTOSUBSRCREL)
28+
29+
# Source dir name, include directories, and sub source dir
30+
NAME := $(shell $(PWD) | $(SED) -e 's_/.*/__' | $(SED) -e 's_\S.*\\__')
31+
INCDIRS = -I../../include -I$(TARGETDIR)/include $(foreach dir,$(strip $(EXTERNINCDIRS)),-I../$(dir))
32+
LCLSRCDIR = src
33+
34+
# Directories for objects, dependencies, and library files
35+
OBJDIR = $(TARGETDIR)/$(TARGETOBJDIRREL)/$(NAME)
36+
DEPDIR = $(TARGETDIR)/$(TARGETDEPDIRREL)/$(NAME)
37+
LIBDIR = $(TARGETDIR)/$(TARGETLIBDIRREL)
38+
39+
# Name of library file, list of source files, object files, and dependency files
40+
LIBFILE = $(LIBDIR)/$(NAME).$(LIBEXT)
41+
SRCFILES := $(shell $(LS) $(LCLSRCDIR)/*.$(SRCEXT))
42+
OBJFILES = $(subst .$(SRCEXT),.$(OBJEXT),$(subst $(LCLSRCDIR),$(OBJDIR),$(SRCFILES)))
43+
DEPFILES = $(subst .$(SRCEXT),.$(DEPEXT),$(subst $(LCLSRCDIR),$(DEPDIR),$(SRCFILES)))
44+
45+
# Used to makes sure source files get built if their dependency files are modified
46+
-include $(DEPFILES)
47+
48+
all: build
49+
50+
build: $(LIBFILE)
51+
52+
$(LIBDIR)/%.$(LIBEXT): $(OBJFILES)
53+
$(ECHO)
54+
$(ECHO) "Building library file '$@'"
55+
$(LIB) $(LFLAGS) $@ $(OBJFILES)
56+
$(ECHO) "Finished building library file '$@'"
57+
$(ECHO)
58+
59+
$(OBJDIR)/%.$(OBJEXT) : $(LCLSRCDIR)/%.$(SRCEXT) $(DEPDIR)/%.$(DEPEXT)
60+
$(ECHO)
61+
$(ECHO) "Building object file '$@'"
62+
[ -d $(OBJDIR) ] || $(MKDIR) $(OBJDIR) > $(BLACKHOLE)
63+
$(CC) $(CFLAGS)
64+
$(ECHO) "Finished building object file '$@'"
65+
66+
$(DEPDIR)/%.$(DEPEXT): $(LCLSRCDIR)/%.$(SRCEXT)
67+
$(ECHO)
68+
$(ECHO) "Building dependency file '$@'"
69+
[ -d $(DEPDIR) ] || $(MKDIR) $(DEPDIR) > $(BLACKHOLE)
70+
$(ECHO) "$(OBJDIR)/" | $(TR) -d '\n' | $(TR) -d '\r' > $@.tmp
71+
$(DEP) $(DFLAGS) >> $@.tmp
72+
$(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.tmp > $@
73+
$(RM) -f $@.tmp
74+
$(ECHO) "Finished building dependency file '$@'"
75+
76+
.SECONDARY: $(OBJFILES) $(DEPFILES)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef TARGET_NRF24LE1_SDK_H_
2+
#define TARGET_NRF24LE1_SDK_H_
3+
4+
//DO NOT include reg24le1.h here or a circular include will happen
5+
//This header file is included by reg24le1.h to provide it a package variant
6+
#define __TARG_PACKAGE_TYPE NRF24LE1_PACKAGE_32_PIN
7+
8+
//Encryption/decryption subsystem #defines
9+
#define __TARG_ENC_DEC_ACCEL_ALLOW_INLINING 1 //If non-zero, this allows the enc_dec_accel_galois_multiply() function to be inlined (requires compiler option --std-c99)
10+
11+
#endif /* TARGET_NRF24LE1_SDK_H_ */

0 commit comments

Comments
 (0)