Commit 19ee34c6 authored by Hyun Soo  Kim's avatar Hyun Soo Kim
Browse files

add code for downloading and compiling database

parent fe2d14e1
Loading
Loading
Loading
Loading

compile_database.c

0 → 100644
+32 −0
Original line number Diff line number Diff line
#include <dirent.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static char cmd_add[] = "./md --addMolecule testcases/molecules/";

int main(void)
{
    DIR *molecule_directory;
    molecule_directory = opendir("testcases/molecules/");

    struct dirent *molecule;

    char cmd_buffer[80];
    strcpy(cmd_buffer, cmd_add);

    if (molecule_directory)
    {
        while ((molecule = readdir(molecule_directory)) != NULL)
        {
            if (molecule->d_type == DT_REG)
            {
                strcpy(&cmd_buffer[sizeof(cmd_add) - 1], molecule->d_name);
                system(cmd_buffer);
            }
        }
        closedir(molecule_directory);
    }
    return 0;
}
+5 −2
Original line number Diff line number Diff line
make: benchmark.c
benchmark: benchmark.c
	gcc -g -O3 -Wall -o benchmark.bin benchmark.c

database: compile_database.c
	gcc -g -O3 -Wall -o compile_database.bin compile_database.c
 No newline at end of file