Add PDCurses and make Windows option
This commit is contained in:
parent
8182b384ba
commit
15879787a5
2 changed files with 22 additions and 6 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "lib/PDCurses"]
|
||||
path = lib/PDCurses
|
||||
url = git@github.com:wmcbrine/PDCurses.git
|
||||
25
Makefile
25
Makefile
|
|
@ -1,5 +1,19 @@
|
|||
CC=clang
|
||||
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
|
||||
|
||||
DIR_SRC=src
|
||||
|
|
@ -16,11 +30,7 @@ else
|
|||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
SRCS=$(wildcard $(DIR_SRC)/*.c)
|
||||
OBJS=$(addprefix $(DIR_OBJ)/,$(addsuffix .o,$(basename $(SRCS))))
|
||||
DEPS=$(addprefix $(DIR_OBJ)/,$(addsuffix .d,$(basename $(SRCS))))
|
||||
|
||||
.PHONY: all install uninstall clean
|
||||
.PHONY: all install uninstall clean PDCurses
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
|
|
@ -40,6 +50,9 @@ $(DIR_OBJ)/$(DIR_SRC)/%.o: $(DIR_SRC)/%.c
|
|||
@echo "compile $<"
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
PDCurses:
|
||||
cd lib/PDCurses/wincon && $(MAKE) -j CC=x86_64-w64-mingw32-gcc
|
||||
|
||||
clean:
|
||||
rm -rf $(DIR_BUILD)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue