- May 11, 2008
- 22,218
- 1,410
- 126
Well, for my current test project with a single library this works.
I had the issues that made an error in the path and i reversed the priority between libraries and object files.
This current makefile works at least with my current library test project.
Now i can try the gtk examples and see if it works as well. And then adapt W-ARM to this all for me.
I had the issues that made an error in the path and i reversed the priority between libraries and object files.
This current makefile works at least with my current library test project.
Now i can try the gtk examples and see if it works as well. And then adapt W-ARM to this all for me.
Code:
# Automatically generated by W-ARM for RPI !
# Do not edit this file with an editor that replaces tabs with spaces !
################################################################################
ECHO = echo.exe
CP = cp.exe
CC = arm-linux-gnueabihf-g++.exe
AS = arm-linux-gnueabihf-g++.exe -x assembler-with-cpp
CREATE_OUTPUT_FILE = arm-linux-gnueabihf-g++ -o MakingALib
################################################################################
#sources setup.
SRC =./src/main.c
ASRC =
################################################################################
# include directories setup.
USR_INC_DIR =./inc
################################################################################
#libraries setup.
LIB = -ltest
# Library directory with LD switches.
LIB_DIR_PATH =-L./lib
################################################################################
# substitution reference OBJS = every module name, replace s with o and every c with o.
OBJS = $(ASRC:.s=.o) $(SRC:.c=.o)
### compiler flags.
# architecture optimizations
MCU_FLAGS = -mcpu=cortex-a53
# compiler optimisation level
OPT =-O1
# debugger
DBGGR =
# floating point unit
FLPU =-mfpu=vfpv4
# compiler flags combined into a single variable.
CP_FLAGS = $(DBGGR) $(FLPU) $(OPT) $(MCU_FLAGS) -Wall -g -Wa,-adhln=$(<:.c=.lst)
# assembler flags combined into a single variable.
AS_FLAGS = $(OPT) $(MCU_FLAGS) -Wa
# linker flags.
LD_FLAGS = $(MCU_FLAGS) $(OBJS) $(LIB_DIR_PATH) -lgcc -lrt $(LIB) -Wl,-Map=./output/MakingALib.map,--cref
# Eye candy.
begin:
@$(ECHO)
@$(ECHO) ---------------- begin ----------------
@$(ECHO)
finished:
@$(ECHO)
@$(ECHO) Errors none.
@$(ECHO)
@$(ECHO) Output format = Raspbian executable
@$(ECHO)
@$(ECHO) Project name = MakingALib
@$(ECHO)
end:
@$(ECHO)
@$(ECHO) ---------------- end ----------------
@$(ECHO)
clean_message:
@$(ECHO)
@$(ECHO) Cleaning directories of current project : MakingALib
@$(ECHO)
# Display compiler version information.
gccversion:
@$(CC) --version
#Execute from here.
all: begin gccversion create move_files finished end
#copy files to new destination.
move_files:
@$(CP) ./src/*.lst ./list/
@$(CP) ./src/*.o ./object/
@$(CP) MakingALib ./output/
@-rm -f ./src/*.lst
@-rm -f ./src/*.o
@-rm -f MakingALib
# create output file.
#Make searches for pattern rules first.
create: $(OBJS)
$(CREATE_OUTPUT_FILE) $(LD_FLAGS)
# This pattern rule is performed for every single c module. One object file for every c module.
%.o : %.c
$(CC) -c $(CP_FLAGS) -I $(USR_INC_DIR) $< -o $@
# This pattern rule is performed for every single assembly module. One object file for every assembly module.
%.o : %.s
$(AS) -c $(AS_FLAGS) -I $(USR_INC_DIR) $< -o $@
clean: begin gccversion deletefiles clean_message end
deletefiles:
@-rm -f $(OBJS)
@-rm -f $(SRC:.c=.c.bak)
@-rm -f $(SRC:.c=.lst)
@-rm -f $(ASRC:.s=.s.bak)
@-rm -f $(ASRC:.s=.lst)
@-rm -fR .dep
@-rm -f ./output/*.map
@-rm -f ./output/MakingALib
@-rm -f ./list/*.lst
@-rm -f ./object/*.o
# Listing of phony targets.
.PHONY : all begin finish end move_files clean_message sizebefore sizeafter gccversion build elf hex lss sym clean clean_list program
# *** EOF ***
Last edited: