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

#include "build.h"

#include "is_updated.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);
}