[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using make for cross compiler under Windows
From: |
Atri |
Subject: |
Using make for cross compiler under Windows |
Date: |
Tue, 27 Jan 2009 00:22:37 -0800 (PST) |
hello
I try to compile a project with a cross compiler of a microcontroller with
GNU make.
I use GNU make 3.81 on windows directly with DOS (not cygwin).
Because I am not familar with make I tried to do this step by step.
At first I tried to build a make that compile a file that is in a src-folder
in the path
of the makefile. This was no problem.
After that I tried to use the capability of the compiler to create a
dependence file for
a source file from my real project. I know this will lead to compiler errors
but I wanted
to check that make can handle with the file and the pathes in that
dependency file.
Now the problems starts. Because of the fact that the pathes are absolut in
this file
I get the known and even discussed error:
*** target pattern contains no `%'. Stop.
The problem is that I have to use abslolut pathes as some sources and
headers in the dep-file goes to another drive (project on D:,
microcontroller dependent
files on C:).
Here is my makefile:
###################################################################
SHELL = C:/WINNT/system32/cmd.exe
/:=$(strip /)
DEVTOOL_INSTALLPATH := C:$/metrowerks_hcs12
DEVTOOL_DERIVATPATH := $(DEVTOOL_INSTALLPATH)$/lib$/HC12c
DEVTOOL_INCLUDEPATH := $(DEVTOOL_DERIVATPATH)$/include
DEVTOOL_PROGPATH := $(DEVTOOL_INSTALLPATH)$/prog
DEVTOOL_LIBPATH := $(DEVTOOL_DERIVATPATH)$/lib
DEVTOOL_SRCPATH := $(DEVTOOL_DERIVATPATH)$/src
PROJECTNAME := CompTestSerialFlash
COMMONPRONAME := CommonCompTest
TARGETNAME := P&E
PROJECTTYPE := applic
PROJECTPATH :=
D:$/views$/tegepat_view_comptest$/embedded_ctc$/CompTest$/HC9S12$/flash$/serial_flash$/$(PROJECTTYPE)
COMMONPROPATH :=
D:$/views$/tegepat_view_comptest$/embedded_ctc$/common$/HC9S12$/source
PROJCOMMONPATH :=
D:$/views$/tegepat_view_comptest$/embedded_ctc$/CompTest$/HC9S12$/flash$/serial_flash$/common$/sources
PROJECT_OBJECTPATH := $(PROJECTPATH)$/bin
PROJECT_SOURCEPATH := $(PROJECTPATH)$/sources
PROJECT_CMDPATH := $(PROJECTPATH)$/cmd
PROJECT_PRMPATH := $(PROJECTPATH)$/prm
PROJECT_RTOSPATH := $(PROJECTPATH)$/RTXC
PROJECT_OPATH :=
$(PROJECTPATH)$/$(PROJECTNAME)_Data$/$(TARGETNAME)$/ObjectCode
LINKFILE := $(PROJECT_PRMPATH)$/linker.prm
BURNERFILE := $(PROJECT_PRMPATH)$/burner.bbl
#GENPATH: Paths where application source and prm files can be
# found
GENPATH :=
$(PROJECTPATH);$(PROJECT_OBJECTPATH);$(PROJECT_CMDPATH);$(PROJECT_PRMPATH);$(PROJECT_SOURCEPATH);$(PROJECT_RTOSPATH);*$(COMMONPROPATH);$(DEVTOOL_LIBPATH);$(DEVTOOL_SRCPATH);$(DEVTOOL_INCLUDEPATH);$(PROJCOMMONPATH)
#OBJPATH: Path where compiler and assembler will place object
files
OBJPATH := $(PROJECT_OBJECTPATH)
#ABSPATH: Path where linker will place executable file
ABSPATH := $(PROJECT_OBJECTPATH)
#TEXTPATH: Path where linker will place map file and compiler
# disassembly listing file and dependency file.
TEXTPATH := $(PROJECT_OBJECTPATH)
ENVOPTIONS := -env"GENPATH=$(GENPATH)" \
-env"LIBPATH=$(DEVTOOL_INCLUDEPATH)" \
-env"OBJPATH=$(OBJPATH)" \
-env"ABSPATH=$(ABSPATH)" \
-env"TEXTPATH=$(TEXTPATH)"
LIBS := $(DEVTOOL_LIBPATH)$/ansisi.lib
TARGET := C_PandE_ICD.abs
COMPILER := $(DEVTOOL_PROGPATH)$/chc12.exe
LINKER := $(DEVTOOL_PROGPATH)$/linker.exe
C_FLAGS := -CpPPAGE=RUNTIME -DHCS12 -DWITH_RTXC -Lasm=%n.lst \
-Lm=$(PROJECT_OBJECTPATH)$/modules.d -LmCfg=ilmu \
-Lo=$(PROJECT_OBJECTPATH)$/objlist.txt -Mb -Onf
include $(PROJECT_OBJECTPATH)$/modules1.d
CCFLAGS= $(C_FLAGS) $(ENVOPTIONS)
%.c.o: %.c
$(COMPILER) $(CCFLAGS) $< -objn="$(PROJECT_OPATH)/$@"
%.C.o: %.C
$(COMPILER) $(CCFLAGS) $< -objn="$(PROJECT_OPATH)/$@"
###################################################################
and the created dependence file from the compiler (I compiled it with the
bad IDE of the compiler)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
main.c.o: \
D:\views\tegepat_view_comptest\embedded_ctc\CompTest\HC9S12\flash\serial_flash\applic\sources\main.c
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\stdint.h \
D:\views\tegepat_view_comptest\embedded_ctc\CompTest\HC9S12\flash\serial_flash\common\sources\hardware.h
\
C:\metrowerks_hcs12\lib\HC12c\INCLUDE\mc9s12dg256.h \
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\stdbool.h
\
D:\views\tegepat_view_comptest\embedded_ctc\CompTest\HC9S12\flash\serial_flash\applic\sources\config.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\RTXCGEN\rtxcapi.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\RTXCGEN\typedef.h
\
D:\views\tegepat_view_comptest\embedded_ctc\CompTest\HC9S12\flash\serial_flash\applic\RTXC\rtxcopts.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\RTXCGEN\rtxstruc.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\RTXCGEN\enable.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\storage\ieeprom.h
\
D:\views\tegepat_view_comptest\embedded_ctc\common\HC9S12\source\storage\intflash.h
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The message I get is:
**** Build of configuration Default for project CompTestSerialFlash ****
make -f Makefile -k
D:/views/tegepat_view_comptest/embedded_ctc/CompTest/HC9S12/flash/serial_flash/applic/bin/modules1.d:2:
*** target pattern contains no `%'. Stop.
I know this problem is already discussed here in this forum but I cannot get
a practical solution for my
project.
By the way, is it possible to invoke a vpath command with an absolut path
(direct or in a variable) and
can I let make search in subfolders of this path (with a * before the folder
it did not work).
Regards and thanks for your help,
Patrik
--
View this message in context:
http://www.nabble.com/Using-make-for-cross-compiler-under-Windows-tp21681360p21681360.html
Sent from the Gnu - Make - W32 mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Using make for cross compiler under Windows,
Atri <=