2 Commits f144a1467e ... c5772bc1f1

Author SHA1 Message Date
  Tom Tsagk c5772bc1f1 Update to version `0.0.5` 2 years ago
  Tom Tsagk b4fcea3a38 Move the temporary `.c` files in the `build` directory when building 2 years ago
2 changed files with 13 additions and 4 deletions
  1. 1 1
      makefile
  2. 12 3
      src/main.c

+ 1 - 1
makefile

@@ -2,7 +2,7 @@
 # package data
 #
 PACKAGE_NAME=avdl
-PACKAGE_VERSION=0.0.4
+PACKAGE_VERSION=0.0.5
 
 #
 # compiler data

+ 12 - 3
src/main.c

@@ -231,9 +231,18 @@ int main(int argc, char *argv[])
 			strcpy(buffer, outname);
 		}
 		else {
-			filename[i][strlen(filename[i]) -2] = 'c';
-			filename[i][strlen(filename[i]) -1] = '\0';
-			strcpy(buffer, filename[i]);
+			// given an outname, compile the .c file in the same directory
+			if (outname) {
+				strcpy(buffer, outname);
+				buffer[strlen(buffer) -1] = 'c';
+				strcpy(filename[i], buffer);
+			}
+			// by default, put .c file in the same directory as source one
+			else {
+				filename[i][strlen(filename[i]) -2] = 'c';
+				filename[i][strlen(filename[i]) -1] = '\0';
+				strcpy(buffer, filename[i]);
+			}
 		}
 		//printf(" to %s\n", buffer);
 		if (transpile_cglut(buffer, game_node) != 0) {