Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add globally defined __TARGET and __CPU to phoenix-rtos-build #145

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ $(info cleaning targets, make parallelism disabled)
.NOTPARALLEL:
endif

# Distribute the __TARGET and __CPU defines
CFLAGS += -D__TARGET_$(call uppercase,$(TARGET_FAMILY))
CXXFLAGS += -D__TARGET_$(call uppercase,$(TARGET_FAMILY))

CFLAGS += -D__CPU_$(call uppercase,$(TARGET_SUBFAMILY))
CXXFLAGS += -D__CPU_$(call uppercase,$(TARGET_SUBFAMILY))

# generic CFLAGS/LDFLAGS
LDFLAGS += -L$(PREFIX_A)

Expand Down
5 changes: 5 additions & 0 deletions makes/funcs.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
### simple utility/shortcut functions ###

# Converts to upper case
uppercase = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))

# Converts to lower case
lowercase = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))

# quick template for adding tests (makes xxx binary from xxx.c with optional libs/dependencies)
# $(eval $(call add_test, NAME [, LIBS][, DEP_LIBS]))
Expand Down
Loading