fixed makefile

This commit is contained in:
Lennart Buhl 2013-11-02 17:29:41 +01:00
parent 6b0ea85e02
commit 3d6344d09f
4 changed files with 21 additions and 22 deletions

1
.gitignore vendored
View File

@ -2,5 +2,6 @@ bin/
out/ out/
net net
test test
*.o
*.swp *.swp
a.out a.out

View File

@ -1,21 +1,18 @@
CFLAGS=-g -Wall -Wextra -std=gnu99 CFLAGS=-g -Wall -Wextra -std=gnu99
TARGET=bin/netsl
OBJECTS=main.o msg.o net.o
all: $(TARGET)
all: bin/netsl $(TARGET): $(OBJECTS)
#bin/net: net.c
# mkdir -pv bin
# gcc -o bin/net net.c
#bin/test: test.c
# mkdir -pv bin
# gcc -o bin/test test.c
bin/netsl: misc.h main.c net.c msg.c msg.h
mkdir -pv bin mkdir -pv bin
gcc $(CFLAGS) -o bin/netsl main.c gcc $^ -o $(TARGET)
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
clean: clean:
rm -rf bin -$(RM) -rf *.o bin

4
main.c
View File

@ -1,10 +1,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include "misc.h" #include "misc.h"
#include "net.c" #include "net.h"
#define MODE_SERVER 0 #define MODE_SERVER 0
#define MODE_CLIENT 1 #define MODE_CLIENT 1

15
msg.h
View File

@ -1,15 +1,16 @@
/* This file was automatically generated. Do not edit! */ /* This file was automatically generated. Do not edit! */
typedef struct message message;
typedef struct Buffer Buffer; typedef struct Buffer Buffer;
void serialize_message(struct message *msg,Buffer *b);
void serialize_string(char *str,Buffer *b);
void serialize_int(int x,Buffer *b);
void append_space(Buffer *b,int n); void append_space(Buffer *b,int n);
struct Buffer *new_buffer(); struct Buffer *new_buffer();
typedef struct message message;
void deserialize(struct message *msg,const char *buf);
void serialize(char *buf,struct message *msg);
int getBufferSize(struct message *msg);
struct message { struct message {
long timestamp; uint32_t timestamp;
int width; // varies uint32_t width; // varies
int height; // normally 80 uint32_t height; // normally 80
//char **image; // dimension is width x height
char *image; // dimension is width x height char *image; // dimension is width x height
}; };
struct Buffer { struct Buffer {