Skip to content

binaryreveal/yaxmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage


Yaxmake : Yet another cross make.

Usage: yaxmake <options>
    options:
      -t or --toolkit=<toolkit>: gnu or msvc, gnu as default
      -l or --language=<lang>  : c or c++, c as default
      -f or --file=<infile>    : input file, default: yaxfile.py
      -d or --debug            : compile in debug mode
      -c or --clean            : clean generated file(s)
      -V or --verbose          : verbose mode
      -v or --version          : show version
      -h or --help             : show this menu

toolkit

gnu - works with GCC/G++, Cygwin(not test), MinGW. msvc - microsoft visutal c++ compiler

language

yaxmake will not detect programming language (this might be supported in new version). Therefore, you should set language to 'c++', if you are developing a c++ project.

debug

this has not been implemented yet.

clean

this command should remove almost generated file(s). but as some file(s) could not track, we just left them in your project, you might remove these files manually. Such as: .exp (msvc), .lib (msvc dll) or others.

Information


To compile a project as you plan, you should create an input file. As default, you should name it as "yaxfile.py". Of course, you could name whatever, but in this case, you should specify your input file with option: -f.

yaxmake.py -f=myname.xyz

or

yaxmake.py --file=whatever.abc

If you are working a C++ project, you'd like the following command line:

yaxmake.py --file=yaxfile.py --language=c++ --toolkit=msvc

or just:

yaxmake.py --language=c++ --toolkit=msvc

Example


Let's consider a simple real project:

Files: hello.h + hello.c = hello.lib (static library)
Files: test.c + hello.lib = test.exe

Directory:

root +- hello.h
     +- hello.c
     +- test.c

We could write yaxfile.py as following:

env.static_library(target='hello', sources=['hello.c'])
env.console_app(target='test', sources=['test.c'], lpaths=['.'], libs=['hello'])

Okay, that's enough!

If you want to compile a dynamic library, try to replace the first line with the following:

env.dynamic_library('hello', ['hello.c'])

And here is a further demo:

# to create a lib file with dll in msvc toolkit
# we should use a def file
linkflags = ''
if env.getToolkit()=='msvc':
    linkflags = '/DEF:hello.def'

env.dynamic_library(
    target="bin/hello_dynamic", 
    sources=['hello.c'], 
    lflags=linkflags)

env.static_library(
    target="bin/hello_static", 
    sources=['hello.c'])

env.console_app(
    target='bin/test_dynamic', 
    sources=['test.c'], 
    lpaths=['bin'], 
    libs=['hello_dynamic'])

env.console_app(
    target='bin/test_static', 
    sources=['test.c'], 
    lpaths=['bin'], 
    libs=['hello_static'])

The yaxmake supports following target:

  1. object
  2. console_app
  3. gui_app
  4. static_library
  5. dynamic_library

For more information, please see the YaxEnvironment in yaxmake/yaxlib/yenv.py.

About

Yet another cross make tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages