Commit 4ab507e0 authored by Mart Lubbers's avatar Mart Lubbers
Browse files

Cleanup and add CI

- remove warnings, trailing spaces and mixed tabs and spaces.
- add ci
parent 473996ee
Pipeline #21187 passed with stage
in 1 minute and 17 seconds
*.o
clm
clms
patch_bin
compile:
image: gcc:latest
script:
- make -f Makefile.linux64
artifacts:
paths:
- clm
CC=gcc
CFLAGS=-O -pedantic -Wall -W
CPPFLAGS=-DGNU_C -DLINUX -DLINUX_ELF -DI486 -DA_64
OBJECTS=clm.o cachingcompiler.o
clm: clm.o cachingcompiler.o
gcc clm.o cachingcompiler.o -o clm
# ./patch_bin clm CLEANLIB $(HOME)/Clean2/exe
# ./patch_bin clm CLEANPATH .:$(HOME)/Clean2/stdenv:$(HOME)/Clean2/iolib
clm: $(OBJECTS)
$(LINK.o) $^ $(LDLIBS) $(OUTPUT_OPTION)
cachingcompiler.o: cachingcompiler.c cachingcompiler.h
clm.o: clm.c cachingcompiler.h
# gcc -pedantic -Wall -c -DGNU_C -DSOLARIS -O clm.c # -mcpu=ppc603 clm.c
clms: clms.o cachingcompiler.o
gcc -s clms.o cachingcompiler.o -o clms
clms.o: clm.c cachingcompiler.h
gcc $(CFLAGS) $(CPPFLAGS) -c -o clms.o -DSYSTEM_LINKER clm.c
clean:
$(RM) $(OBJECTS) clm
# clm - Clean make - version 3.0
## Automatic builds
clm is included in all clean distributions. However, if you cannot wait for the
nightly build you can download one of the automatic builds here:
- [linux-64](https://gitlab.science.ru.nl/clean-and-itasks/clm/builds/artifacts/master/file/clm/clm?job=compile)
......@@ -55,14 +55,16 @@ static int wait_for_child (pid_t pid, char *child_name, int *status_p)
*status_p=stat;
result = WEXITSTATUS (stat);
if (WIFSIGNALED(stat) != 0)
log_error ("%s signaled (%d)\n",child_name, (int) WTERMSIG(stat));
else if (WIFEXITED (stat))
if (WIFSIGNALED(stat) != 0) {
log_error ("%s signaled (%d)\n",child_name, (int) WTERMSIG(stat));
} else if (WIFEXITED (stat)) {
log_error ("%s exited normally (%d)\n", child_name, (int) WEXITSTATUS(stat));
else
log_error ("%s exited abnormally (%d)\n",child_name, (int) result);
} else {
log_error ("%s exited abnormally (%d)\n",child_name, (int) result);
}
return result;
(void)child_name;
}
static void error (char *error_string)
......@@ -127,6 +129,7 @@ static void cleanup_compiler_at_exit (void)
cleanup_compiler ();
}
/*
static void cleanup_compiler_on_signal (int signal_no)
{
log_error ("cleanup_compiler_on_signal\n");
......@@ -141,6 +144,7 @@ static void child_died (int signal_no)
compiler_pid=0;
}
}
*/
static void init_caching_compiler(void)
{
......@@ -183,7 +187,7 @@ int start_caching_compiler_with_args (CleanCharArray cocl_path,char *cocl_argv[]
#if 1
static char compiler_commands_file_name[]="/tmp/comXXXXXX";
int fd;
fd=mkstemp (compiler_commands_file_name);
if (fd<0){
perror ("clm: mkstemp failed");
......@@ -206,7 +210,7 @@ int start_caching_compiler_with_args (CleanCharArray cocl_path,char *cocl_argv[]
#if 1
static char compiler_results_file_name[]="/tmp/resXXXXXX";
int fd;
fd=mkstemp (compiler_results_file_name);
if (fd<0){
perror ("clm: mkstemp failed");
......@@ -239,7 +243,7 @@ int start_caching_compiler_with_args (CleanCharArray cocl_path,char *cocl_argv[]
cocl_argv[cocl_argv_size-1]=(char *)0;
execvp ((char *)cocl_path,cocl_argv);
}
log_error ("cocl path = %s\n", cocl_path);
perror ("clm: can't start the clean compiler");
exit(1);
......@@ -263,7 +267,7 @@ int start_caching_compiler_with_args (CleanCharArray cocl_path,char *cocl_argv[]
exit(1);
}
return (0);
return (0);
}
int start_caching_compiler (CleanCharArray cocl_path)
......@@ -287,7 +291,7 @@ int call_caching_compiler (CleanCharArray args)
if (compiler_pid == 0)
error ("call_compiler: compiler not running");
fputs ((const char *) args,compiler_commands);
fputc ('\n',compiler_commands);
fflush (compiler_commands);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment