shared library 제작

페이지 정보

작성자 조희승 댓글 0건 조회 5,612회 작성일 13-12-26 17:45

본문

#include <stdio.h>
int cgpm_isgpu(char *task)
{
 return 1;
}
 
 
 
 CC = gcc
CFLAGS = -Wall -g -fPIC
#CFLAGS = -Wall -O3
#CFLAGS = -w -O2 -fpack-struct
#LIBS= -lm -lpthread
LIBS=
DFLAGS =
bin=libcgpm
t1=cgpm
obj=$(t1).o
# shared .so
#all:
# $(CC) -c $(t1).c
# $(CC) -shared -W1,-soname,libcgpm.so -o libcgpm.so $(t1).o
# static .a
all:
 $(CC) -c $(t1).c
 ar rc libcgpm.a $(t1).o
clean:
 rm -f *.so *.a *.o
 
 
 
 
 
#include <stdio.h>
void main(void)
{
 int i=100;
 i=cgpm_isgpu("ddd");
 printf("%d\n", i);
}
 
CC = gcc
CFLAGS = -Wall -g
#CFLAGS = -Wall -O3
#CFLAGS = -w -O2 -fpack-struct
#LIBS= -lm -lpthread
LIBS= -L.. -lcgpm
DFLAGS =
bin=t
t1=main
a1=../libcgpm.a
#obj=$(t1).o $(t2).o
obj=$(t1).o
all: $(bin)
$(bin): $(obj)
 $(CC) $(obj) -o $@ $(LIBS)

clean:
 rm -f $(bin) *.o
 
 
 

댓글목록

등록된 댓글이 없습니다.