forked from pyrite-dev/milsko
idk what i did
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@446 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
d263f6abb1
commit
1dbe11aca0
49 changed files with 97 additions and 1715 deletions
27
GNUmakefile
27
GNUmakefile
|
|
@ -9,7 +9,6 @@ endif
|
|||
USE_STB_IMAGE = 1
|
||||
|
||||
CC = $(GCC)gcc
|
||||
CXX = $(GCC)g++
|
||||
|
||||
CFLAGS = -Wall -Wextra -Wno-implicit-fallthrough -Wno-sign-compare -Iinclude
|
||||
LDFLAGS =
|
||||
|
|
@ -38,13 +37,6 @@ L_OBJS += src/widget/window.o src/widget/button.o src/widget/frame.o src/widget/
|
|||
L_OBJS += src/cursor/hidden.o src/cursor/default.o src/cursor/cross.o src/cursor/text.o
|
||||
L_OBJS += src/icon/question.o src/icon/warning.o src/icon/note.o src/icon/info.o src/icon/news.o src/icon/error.o src/icon/file.o src/icon/directory.o src/icon/back.o src/icon/forward.o src/icon/up.o src/icon/computer.o src/icon/search.o
|
||||
|
||||
OOL_CXXFLAGS = $(DEPINC) $(CFLAGS) -std=c++98 -fPIC
|
||||
OOL_LDFLAGS = $(LDFLAGS) -L src
|
||||
OOL_LIBS = $(LIBS) -lMw
|
||||
|
||||
OOL_OBJS = oosrc/base.o
|
||||
include oosrc/deps.mk
|
||||
|
||||
E_CFLAGS = $(CFLAGS)
|
||||
E_LDFLAGS = $(LDFLAGS) -Lsrc
|
||||
E_LIBS = $(LIBS) -lMw
|
||||
|
|
@ -113,7 +105,6 @@ endif
|
|||
ifeq ($(WINDOWS),1)
|
||||
L_CFLAGS += -DUSE_GDI
|
||||
L_LDFLAGS += -Wl,--out-implib,src/libMw.a -static-libgcc
|
||||
OOL_LDFLAGS += -Wl,--out-implib,oosrc/libMwOO.a -static-libgcc
|
||||
L_OBJS += src/backend/gdi.o
|
||||
L_LIBS += -lgdi32
|
||||
|
||||
|
|
@ -145,47 +136,40 @@ EXAMPLES = examples/basic/example$(EXEC) examples/basic/rotate$(EXEC) examples/b
|
|||
|
||||
ifeq ($(OPENGL),1)
|
||||
L_OBJS += src/widget/opengl.o
|
||||
OOL_OBJS += oosrc/widget/opengl.o
|
||||
EXAMPLES += examples/gldemos/clock$(EXEC) examples/gldemos/triangle$(EXEC) examples/gldemos/gears$(EXEC) examples/gldemos/boing$(EXEC) examples/gldemos/cube$(EXEC) examples/gldemos/tripaint$(EXEC)
|
||||
endif
|
||||
|
||||
ifeq ($(VULKAN),1)
|
||||
L_OBJS += src/widget/vulkan.o
|
||||
OOL_OBJS += oosrc/widget/vulkan.o
|
||||
EXAMPLES += examples/vkdemos/vulkan$(EXEC)
|
||||
endif
|
||||
|
||||
.PHONY: all install format clean lib oolib examples
|
||||
.PHONY: all install format clean lib examples
|
||||
|
||||
all: lib examples
|
||||
lib: src/$(LIB)Mw$(SO)
|
||||
oolib: oosrc/$(LIB)MwOO$(SO)
|
||||
examples: $(EXAMPLES)
|
||||
|
||||
install: lib oolib
|
||||
install: lib
|
||||
mkdir -p $(PREFIX)/lib
|
||||
mkdir -p $(PREFIX)/bin
|
||||
mkdir -p $(PREFIX)/include
|
||||
mkdir -p $(PREFIX)/share/doc/milsko
|
||||
for i in src oosrc; do \
|
||||
for i in src; do \
|
||||
cp $$i/*.so $(PREFIX)/lib/ ; \
|
||||
cp $$i/*.a $(PREFIX)/lib/ ; \
|
||||
cp $$i/*.dll $(PREFIX)/bin/ ; \
|
||||
done ; true
|
||||
cp -rf include/Mw $(PREFIX)/include/
|
||||
cp -rf include/MwOO $(PREFIX)/include/
|
||||
cp -rf doc/* $(PREFIX)/share/doc/milsko/
|
||||
|
||||
format:
|
||||
clang-format --verbose -i `find oosrc src include examples tools "(" -name "*.c" -or -name "*.h" ")" -and -not -name "stb_*.h"`
|
||||
clang-format --verbose -i `find src include examples tools "(" -name "*.c" -or -name "*.h" ")" -and -not -name "stb_*.h"`
|
||||
perltidy -b -bext='/' --paren-tightness=2 `find tools -name "*.pl"`
|
||||
|
||||
src/$(LIB)Mw$(SO): $(L_OBJS)
|
||||
$(CC) $(L_LDFLAGS) $(SHARED) -o $@ $^ $(L_LIBS)
|
||||
|
||||
oosrc/$(LIB)MwOO$(SO): $(OOL_OBJS) src/$(LIB)Mw$(SO)
|
||||
$(CC) $(OOL_LDFLAGS) $(SHARED) -o $@ $(OOL_OBJS) $(OOL_LIBS)
|
||||
|
||||
examples/gldemos/%$(EXEC): examples/gldemos/%.o src/$(LIB)Mw$(SO)
|
||||
$(CC) $(E_LDFLAGS) -o $@ $< $(E_LIBS) $(GL)
|
||||
|
||||
|
|
@ -195,9 +179,6 @@ examples/%$(EXEC): examples/%.o src/$(LIB)Mw$(SO)
|
|||
src/%.o: src/%.c
|
||||
$(CC) $(L_CFLAGS) -c -o $@ $<
|
||||
|
||||
oosrc/%.o: oosrc/%.cc
|
||||
$(CXX) $(OOL_CXXFLAGS) -fno-exceptions -fno-rtti -c -o $@ $<
|
||||
|
||||
external/%.o: external/%.c
|
||||
$(CC) $(L_CFLAGS) -Wno-unused-value -Wno-unused-parameter -c -o $@ $<
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue