aboutsummaryrefslogtreecommitdiff
path: root/src/build.c
blob: e5be9b2a9f77020b1fd111207b79d6ad99a2cfd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "build.h"
#include "lua_build.h"
#include "vars.h"

void build(Pkg pkg) {
  char cwd[MAX_PATH_LEN];
  getcwd(cwd, MAX_PATH_LEN);
  if (strcmp(pkg.src, cwd) != 0 && !pkg.is_local) chdir(pkg.src);

  if (lua_build(pkg.name, pkg.target, pkg.is_local ? cwd : pkg.src)) return;
  printf("%s no usable build system was found\n", print_error);
  exit(EXIT_FAILURE);
}