diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-11-12 23:53:02 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-11-12 23:53:02 +0100 |
commit | 45e83f1af71ff0b0bceb9359d8ecf2dee5b3e518 (patch) | |
tree | 35661cd93bfe7c4807e3e59ad06081104123653f | |
parent | tweaks (diff) | |
download | glouglou-45e83f1af71ff0b0bceb9359d8ecf2dee5b3e518.tar.xz glouglou-45e83f1af71ff0b0bceb9359d8ecf2dee5b3e518.zip |
compilation basics
-rw-r--r-- | libglouglou/Makefile | 23 | ||||
-rw-r--r-- | libglouglou/gg_server.c | 10 |
2 files changed, 29 insertions, 4 deletions
diff --git a/libglouglou/Makefile b/libglouglou/Makefile index f1aa0ba..33df3a6 100644 --- a/libglouglou/Makefile +++ b/libglouglou/Makefile @@ -1,13 +1,28 @@ +CFLAGS += $(shell pkg-config --cflags elementary evas ecore) +LIBS += $(shell pkg-config --libs elementary evas ecore) +CFLAGS += -Wall -O2 + PREFIX=/usr/local INCLUDEDIR=$(PREFIX)/include +LIBDIR=$(PREFIX)/lib LIBNAME=libglouglou -all: - @echo "$(LIBNAME) can only be installed, do" - @echo "sudo make install" +TARGET = ${LIBNAME}.so +SOURCES = $(shell echo *.c) +HEADERS = $(shell echo *.h) +OBJECTS = $(SOURCES:.c=.o) + +all: $(TARGET) + +$(TARGET): $(OBJECTS) + $(CC) -shared -o $(TARGET) $(OBJECTS) install: @echo "installation of $(LIBNAME)" + mkdir -p $(LIBDIR) mkdir -p $(INCLUDEDIR) - install -m 0644 $(LIBNAME).h $(INCLUDEDIR) + install -m 0644 $(OBJECTS).h $(LIBDIR) + install -m 0644 $(HEADERS).h $(INCLUDEDIR) +clean: + rm -f $(TARGET) $(OBJECTS) diff --git a/libglouglou/gg_server.c b/libglouglou/gg_server.c new file mode 100644 index 0000000..3f075e0 --- /dev/null +++ b/libglouglou/gg_server.c @@ -0,0 +1,10 @@ +struct gg_server { +}; + +struct gg_packet { +}; + +struct gg_server * +gg_server_start(char *ip, int port, + int (*handle_conn)(struct gg_server *s, int client_id, struct sockaddr_in *addr), + int (*handle_packet)(struct gg_server *s, struct gg_packet *p)); |