first commit
This commit is contained in:
commit
1ecdc57a75
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
example
|
||||
/*.o
|
||||
/*.a
|
||||
/*.swp
|
14
Makefile
Normal file
14
Makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
CFLAGS= -Wall -Wextra -Wfatal-errors -g3
|
||||
LDFLAGS= -s
|
||||
OBJS=
|
||||
RSFLAGS= --target=x86_64-unknown-linux-gnu --crate-type=staticlib
|
||||
|
||||
all: example
|
||||
example: main.o librs.a
|
||||
$(CC) $(LDFLAGS) $^ -o $@
|
||||
lib%.a: %.rs
|
||||
rustc --target=x86_64-unknown-linux-gnu --crate-type=staticlib $^
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $^
|
||||
clean:
|
||||
$(RM) $(OBJS) example *.o librs.a
|
8
main.c
Normal file
8
main.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include<stdio.h>
|
||||
extern int ok(int*x);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int a[]={2,3,4};
|
||||
printf("ok:%d\n",ok(a));
|
||||
}
|
Loading…
Reference in New Issue
Block a user