Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Makefile 709 Bytes
Copy Edit Web IDE Raw Blame History
Sachs authored 2013-05-29 14:29 . init
PLATFORM ?= $(shell uname)
CC = gcc
SRCS = main.c view.c server.c client.c
LIBS = -liup -lpthread
SRC_DIR = ./src
BIN_DIR = ./bin
ifeq ($(findstring Linux,$(PLATFORM)),Linux)
EXE = .out
SRCS += socket_linux.c string_value_utf8.c
EXE = .exe
SRCS += socket_win32.c string_value_gbk.c
LIBS += -lmingw32 -lgdi32 -luser32 -lcomdlg32 \
-lcomctl32 -luuid -lole32 -lwsock32 -lkernel32 -mwindows
OBJS = $(SRCS:%.c=%.o)
BIN = chatroom$(EXE)
all: bin
run: bin
cd $(BIN_DIR) && ./$(BIN)
@cd $(SRC_DIR) && rm -f $(OBJS)
bin: $(BIN_DIR)/$(BIN)
$(BIN_DIR)/$(BIN): $(OBJS:%=$(SRC_DIR)/%)
$(CC) -o $@ $^ $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
.PHONY: all bin run clean

Comment ( 0 )

Sign in for post a comment