fix makefiles etc for subdirs

This commit is contained in:
grischka
2009-04-18 14:31:35 +02:00
parent ea5e81bd6a
commit 5829791ffa
13 changed files with 325 additions and 284 deletions

View File

@ -1,7 +1,7 @@
#! /usr/local/bin/tcc -run
#include <tcclib.h>
int main()
int main()
{
printf("Hello World\n");
return 0;

View File

@ -1,4 +1,5 @@
#include "tcclib.h"
#include <stdlib.h>
#include <stdio.h>
#define N 20
@ -23,7 +24,7 @@ int find(int n, int i1, int a, int b, int op)
return 1;
tab[i1] = n;
}
for(i=0;i<nb_num;i++) {
for(j=i+1;j<nb_num;j++) {
a = tab[i];
@ -52,7 +53,7 @@ int find(int n, int i1, int a, int b, int op)
if (find(c, i, b, a, '/'))
return 1;
}
stack_ptr--;
tab[i] = a;
tab[j] = b;
@ -66,7 +67,7 @@ int find(int n, int i1, int a, int b, int op)
int main(int argc, char **argv)
{
int i, res, p;
if (argc < 3) {
printf("usage: %s: result numbers...\n"
"Try to find result from numbers with the 4 basic operations.\n", argv[0]);
@ -85,7 +86,7 @@ int main(int argc, char **argv)
res = find(0, 0, 0, 0, ' ');
if (res) {
for(i=0;i<=stack_ptr;i++) {
printf("%d %c %d = %d\n",
printf("%d %c %d = %d\n",
stack_res[3*i], stack_op[i],
stack_res[3*i+1], stack_res[3*i+2]);
}

View File

@ -1,4 +1,5 @@
#include <tcclib.h>
#include <stdlib.h>
#include <stdio.h>
int fib(n)
{
@ -8,7 +9,7 @@ int fib(n)
return fib(n-1) + fib(n-2);
}
int main(int argc, char **argv)
int main(int argc, char **argv)
{
int n;
if (argc < 2) {
@ -16,7 +17,7 @@ int main(int argc, char **argv)
"Compute nth Fibonacci number\n");
return 1;
}
n = atoi(argv[1]);
printf("fib(%d) = %d\n", n, fib(n, 2));
return 0;

View File

@ -1,9 +1,10 @@
#!./tcc -run -L/usr/X11R6/lib -lX11
#include <stdlib.h>
/* Yes, TCC can use X11 too ! */
#include <stdio.h>
#include <X11/Xlib.h>
/* Yes, TCC can use X11 too ! */
int main(int argc, char **argv)
{
Display *display;
@ -16,8 +17,8 @@ int main(int argc, char **argv)
}
printf("X11 display opened.\n");
screen = XScreenOfDisplay(display, 0);
printf("width = %d\nheight = %d\ndepth = %d\n",
screen->width,
printf("width = %d\nheight = %d\ndepth = %d\n",
screen->width,
screen->height,
screen->root_depth);
XCloseDisplay(display);

View File

@ -1,7 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
int main()
int main()
{
printf("Hello World\n");
return 0;