Commit 126b0141 authored by Joanne Hugé's avatar Joanne Hugé

Add arm executable for server side

parent 84ff303b
ARM_CC = arm-linux-gnueabihf-gcc
ARM_PROG = main_arm
PROG = main PROG = main
SRCDIR = ../src SRCDIR = ../src
SRCS = main.c SRCS = main.c
OBJS = $(SRCS:%.c=%.o) OBJS = $(SRCS:%.c=%.o)
DEPS = $(SRCS:%.c=%.d)
CFLAGS = -O1 -g -Wall -Werror -Wextra CFLAGS = -O1 -g -Wall -Werror -Wextra
CFLAGS += -MD -MP CFLAGS += -MD -MP
...@@ -13,15 +14,23 @@ CFLAGS += -std=gnu99 ...@@ -13,15 +14,23 @@ CFLAGS += -std=gnu99
vpath %.c $(SRCDIR) vpath %.c $(SRCDIR)
$(ARM_PROG): FORCE
make clean
make -e CC:=arm-linux-gnueabihf-gcc $(PROG)
mv $(PROG) $(ARM_PROG)
FORCE:
$(PROG): $(OBJS) $(PROG): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@ $(CC) $(LDFLAGS) $^ -o $@
-include $(DEPS) -include $(subst .c,.d,$(SRCS))
run: $(PROG) run: $(PROG)
./$^ ./$^
clean: clean:
$(RM) $(PROG) $(OBJS) $(DEPS) $(RM) $(OBJS) $(PROG) $(subst .c,.d,$(SRCS))
.PHONY: clean, run .PHONY: clean FORCE
...@@ -21,7 +21,7 @@ static void *get_in_addr(struct sockaddr *sa) { ...@@ -21,7 +21,7 @@ static void *get_in_addr(struct sockaddr *sa) {
int main() { int main() {
int status; int status;
int sockfd; int sockfd = 0;
struct addrinfo hints, *servinfo, *servinfo_it; struct addrinfo hints, *servinfo, *servinfo_it;
int bytes_received = 0; int bytes_received = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment