ラベル C の投稿を表示しています。 すべての投稿を表示
ラベル C の投稿を表示しています。 すべての投稿を表示

2009/06/18

Cygwin - make header files

source file name : test.c
header file name : test.h

make o-file:
gcc -mno-cygwin -c test.c


---------- test.c ----------

#include <stdio.h>

int test-function( int age, int height, int weight){

printf("input your age : "); scanf("%d",&age);
printf("input your height : "); scanf("%d",&height);
printf("input your wight : "); scanf("%d",&wight);

printf("your data\n");
printf("age : %d\n",age);
printf("height : %d\n",height);
printf("wight : %d\n",wight);

return 0;

}

---------- test.h ----------

int test-function( int age, int height, int weight);

Cygwin - makefile of C

Command of ompile:make

exefile.exe: file1.o file2.o
gcc -mno-cygwin file1.o file2.o -o exefile.exe

file1.o: file1.c
gcc -mno-cygwin -c file1.c

file2.o: file2.c
gcc -mno-cygwin -c file2.c