Reorganize and make compilable

This commit is contained in:
Dendy 2021-02-07 10:20:41 +01:00
parent 9a3c9fc053
commit 5cc3007176
Signed by: dendy
GPG Key ID: 0168B35FFD7F608F
9 changed files with 51 additions and 21 deletions

28
Makefile Normal file
View File

@ -0,0 +1,28 @@
##
# Nodesystem
#
# @file
# @version 0.1
CC="tcc"
DIR=build
SRC=src
OBJ_FLAGS=-c -Wall -Werror -I include/
all: $(DIR)/node.o $(DIR)/node2d.o
$(CC) -shared -o libnodesystem.so $^
build/node.o: $(SRC)/node.c $(DIR)
$(CC) $(OBJ_FLAGS) $(SRC)/node.c -o $@
build/node2d.o: $(SRC)/node2d.c $(DIR)
$(CC) $(OBJ_FLAGS) $(SRC)/node2d.c -o $@
$(DIR):
mkdir $(DIR)
clean:
rm -rf build
rm -f libnode.so
# end

View File

@ -0,0 +1,19 @@
##
# Nodesystem
#
# @file
# @version 0.1
CC="tcc"
SRC=main.c
main: $(SRC)
tcc -o $@ -I ../include $(SRC) -lnodesystem -L/strg/prgm/c/nodesystem
run: main
LD_LIBRARY_PATH=..:$LD_LIBRARY_PATH ./main
clean:
rm -rf main
# end

View File

@ -1,7 +1,7 @@
#include<stdio.h>
#include "node/node.h"
#include "node2d/node2d.h"
#include "node.h"
#include "node2d.h"
int main(int argc, char* *argv){
NOD_Node *distros = NOD_CreateNode("Distros");

View File

@ -1,5 +1,5 @@
#include"../node/node.h"
#include"../types.h"
#include"node.h"
#include"types.h"
#include<stdio.h>
#include<stdlib.h>

View File

@ -1,17 +0,0 @@
##
# Nodesystem
#
# @file
# @version 0.1
CC="tcc"
SRC=main.c ../node/node.c ../node2d/node2d.c
main: $(SRC)
tcc -o $@ -I ../ $(SRC)
clean:
rm -rf main
# end