Hello Youngcheol.
you can use Codewarrior create your own lib file. To create .lib file, you need follow the steps below.(please also refer the attached mylib project)
- Create one project with wizard.(I use QG8 as target chip)
- change the file name main.c as the lib name (in sample is mylib.c)
- define the lib functions in mylib.c
- add header file mylib.h in the project, and declare the prototype of the lib functions in it.
- add “#include mylib.h” in mylib.c
- delete the following files from the project: start08.c, derivative.h, *.prm, MC9S08QG8.h, MC9S08QG8.c, ansiis.lib.c
- Press ALT+F7, in “Target Setting”, select “Libmaker for HC08” as Linker in the second droplist. In “Libmaker for HC08”, name your Library Filename.(the sample use mylib.lib), Click OK to close this window.
- Compile again. In “bin” folder of the lib project, you could find the lib file named “mylib.lib”
The following is how to use the lib file in the project:
- copy “mylib.lib” and “mylib.h” to your current project folder.
- import “mylib.lib” and “mylib.h” in your current project
- add “#include "mylib.h"”in the main.c file
- then you can use the lib functions in your current project code.
see attached demo code
I hope this information is helpful to you.
Best Regards,
Zhang Jun
==================================
if this answer helps, please click on "Correct Answer" button. thanks!
=====================================