Add makefile to examples

This commit is contained in:
rexy712 2020-03-26 13:12:35 -07:00
parent 23dc0814a5
commit e82e469356
3 changed files with 15 additions and 1 deletions

3
doc/examples/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
output
parse
*.o

11
doc/examples/makefile Normal file
View File

@ -0,0 +1,11 @@
.PHONY: all
all: parse output
parse:
gcc -ggdb -I../../include -L../../build parse.c -Wall -Wextra -pedantic -o parse -lrjp
output:
gcc -ggdb -I../../include -L../../build output.c -Wall -Wextra -pedantic -o output -lrjp
clean:
rm parse
rm output

View File

@ -6,7 +6,7 @@ int main(){
RJP_value* root = rjp_new_object();
//add a member and set its type
RJP_value* member = rjp_new_member_key_copy(root, "key", 0);
RJP_value* member = rjp_new_member(root, "key", 0);
rjp_set_int(member, 5);
//output into rjp_alloc'd buffer