My favorites | Sign in
Project Logo
                
Show all Featured wiki pages:
CodeScratches SmartExamples
People details
Project owners:
  duzy.chan

Smart Make is a tool of the similar functions as GNU Make, but it's smarter and more programitive. You can use a full featured programming language for doing jobs to generate targets, the language which is the smart programming language.

Well, here is a simple example for generating executable foo from the source foo.cpp using smart:

link($@, $<) {
  shell:
        gcc -o $@, $< -Iinclude
  
}

compile($@, $<) {
  shell:
        gcc -c -o $@ $< -Llibs -la
}

foo: foo.o {
  link $@, $<;
}

foo.o: foo.cpp {
  compile $@, $<;
}

See more examples here.

Smart Make is running in Parrot VM, input files for smart is called Smartfile, which can be compiled into pir or pbc files that could be directly executed by the parrot command.

As a compatibility with GNU Make, a generic Makefile can also be processed by smart, smart is treating it as normal Smartfile, which can also be compiled into parrot bytecode.

As an example, the following code can be processed by smart and have the same effects as GNU Make does:

CXX = gcc
CXXFLAGS = -Iinclude
LDFLAGS = -Llib
foo.exe: foo.o
        $(GCC) -o $@ $< $(LDFLAGS) $(LOADLIBRES)
foo.o: foo.cpp
        $(GCC) $(CXXFLAGS) -c $< -o $@








Hosted by Google Code