Untested serial implementation for windows
This commit is contained in:
parent
be0e8a997c
commit
4eaac6d822
9 changed files with 213 additions and 70 deletions
43
Makefile
43
Makefile
|
|
@ -1,27 +1,30 @@
|
|||
TARGET_OS=LINUX
|
||||
|
||||
CFLAGS=-Wall -MMD -pthread -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=199309L
|
||||
|
||||
SRCS=$(wildcard $(DIR_SRC)/*.c)
|
||||
OBJS=$(addprefix $(DIR_OBJ)/,$(addsuffix .o,$(basename $(SRCS))))
|
||||
DEPS=$(addprefix $(DIR_OBJ)/,$(addsuffix .d,$(basename $(SRCS))))
|
||||
|
||||
ifeq ($(TARGET_OS), LINUX)
|
||||
CC=clang
|
||||
else
|
||||
CC=x86_64-w64-mingw32-gcc
|
||||
CFLAGS+=-Llib/PDCurses/wincon -Llib/PDCurses
|
||||
DEPS+=PDCurses
|
||||
endif
|
||||
|
||||
LDFLAGS=-lpthread -lncurses
|
||||
OS=LINUX
|
||||
|
||||
DIR_SRC=src
|
||||
DIR_BUILD=build
|
||||
DIR_OBJ=$(DIR_BUILD)/obj
|
||||
DIR_BIN=$(DIR_BUILD)/bin
|
||||
|
||||
TARGET=$(DIR_BIN)/bytenuts
|
||||
CFLAGS=-Wall -MMD -pthread -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=199309L
|
||||
LIB_DEPS=
|
||||
LIB_OBJS=
|
||||
|
||||
SRCS=$(wildcard $(DIR_SRC)/*.c)
|
||||
OBJS=$(addprefix $(DIR_OBJ)/,$(addsuffix .o,$(basename $(SRCS))))
|
||||
DEPS=$(addprefix $(DIR_OBJ)/,$(addsuffix .d,$(basename $(SRCS))))
|
||||
|
||||
ifeq ($(OS), LINUX)
|
||||
CC=clang
|
||||
LDFLAGS=-lncurses -lpthread
|
||||
TARGET=$(DIR_BIN)/bytenuts
|
||||
else
|
||||
CC=x86_64-w64-mingw32-gcc
|
||||
CFLAGS+=-Ilib/PDCurses/wincon/ -Ilib/PDCurses/
|
||||
LDFLAGS=-lpthread -static
|
||||
LIB_DEPS+=PDCurses
|
||||
LIB_OBJS+=lib/PDCurses/wincon/*.o
|
||||
TARGET=$(DIR_BIN)/bytenuts.exe
|
||||
endif
|
||||
|
||||
DEBUG ?= 0
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
|
@ -40,10 +43,10 @@ install:
|
|||
uninstall:
|
||||
rm -f /usr/local/bin/bytenuts
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(TARGET): $(OBJS) $(LIB_DEPS)
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "link and compile for $@"
|
||||
@$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS)
|
||||
@$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIB_OBJS)
|
||||
|
||||
$(DIR_OBJ)/$(DIR_SRC)/%.o: $(DIR_SRC)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
|
|
|
|||
Loading…
Reference in a new issue