More makefile work.
This commit is contained in:
parent
e04e5dc90f
commit
f19d3cd0c7
|
@ -1,8 +1,5 @@
|
||||||
# 16 october 2015
|
# 16 october 2015
|
||||||
|
|
||||||
OUTDIR = out
|
|
||||||
OBJDIR = .obj
|
|
||||||
|
|
||||||
OFILES = \
|
OFILES = \
|
||||||
$(subst /,_,$(CFILES)) \
|
$(subst /,_,$(CFILES)) \
|
||||||
$(subst /,_,$(MFILES)) \
|
$(subst /,_,$(MFILES)) \
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
# silence entering/leaving messages
|
# silence entering/leaving messages
|
||||||
MAKEFLAGS += --no-print-directory
|
MAKEFLAGS += --no-print-directory
|
||||||
|
|
||||||
|
OUTDIR = out
|
||||||
|
OBJDIR = .obj
|
||||||
|
|
||||||
# MAME does this so :/
|
# MAME does this so :/
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
OS = windows
|
OS = windows
|
||||||
|
@ -29,10 +32,10 @@ ifndef ARCH
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libui:
|
libui:
|
||||||
@$(MAKE) -f GNUmakefile.libui OS=$(OS) ARCH=$(ARCH)
|
@$(MAKE) -f GNUmakefile.libui OS=$(OS) ARCH=$(ARCH) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@$(MAKE) -f GNUmakefile.libui OS=$(OS) ARCH=$(ARCH) clean
|
@$(MAKE) -f GNUmakefile.libui OS=$(OS) ARCH=$(ARCH) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR) clean
|
||||||
|
|
||||||
test: libui
|
test: libui
|
||||||
@$(MAKE) -f GNUmakefile.test OS=$(OS) ARCH=$(ARCH)
|
@$(MAKE) -f GNUmakefile.test OS=$(OS) ARCH=$(ARCH) OUTDIR=$(OUTDIR) OBJDIR=$(OBJDIR)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# 16 october 2015
|
# 16 october 2015
|
||||||
|
|
||||||
|
include $(OS)/GNUosspecific.mk
|
||||||
include common/GNUmakeinc.mk
|
include common/GNUmakeinc.mk
|
||||||
include $(OS)/GNUmakeinc.mk
|
include $(OS)/GNUmakeinc.mk
|
||||||
|
|
||||||
|
@ -12,6 +13,8 @@ NAME = libui
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-fPIC
|
-fPIC
|
||||||
|
|
||||||
|
SUFFIX = $(LIBSUFFIX)
|
||||||
|
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
-shared \
|
-shared \
|
||||||
-fPIC \
|
-fPIC \
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# 16 october 2015
|
# 16 october 2015
|
||||||
|
|
||||||
|
include $(OS)/GNUosspecific.mk
|
||||||
include test/GNUmakeinc.mk
|
include test/GNUmakeinc.mk
|
||||||
|
|
||||||
HFILES += \
|
HFILES += \
|
||||||
|
@ -7,35 +8,10 @@ HFILES += \
|
||||||
|
|
||||||
NAME = test
|
NAME = test
|
||||||
|
|
||||||
SUFFIX =
|
SUFFIX = $(EXESUFFIX)
|
||||||
ifeq ($(OS),windows)
|
|
||||||
SUFFIX = .exe
|
|
||||||
endif
|
|
||||||
|
|
||||||
# TODO split out this logic somehow
|
# TODO what's the difference between doing this and linking to out/libui.so directly?
|
||||||
ifeq ($(OS),windows)
|
# LDFLAGS += -L$(OUTDIR) -lui
|
||||||
ifeq ($(ARCH),amd64)
|
LDFLAGS += $(OUTDIR)/libui$(LIBSUFFIX)
|
||||||
ifndef CC
|
|
||||||
CC = x86_64-w64-mingw32-gcc
|
|
||||||
endif
|
|
||||||
ifndef RC
|
|
||||||
RC = x86_64-w64-mingw32-windres
|
|
||||||
endif
|
|
||||||
else ifeq ($(ARCH),386)
|
|
||||||
ifndef CC
|
|
||||||
CC = i686-w64-mingw32-gcc
|
|
||||||
endif
|
|
||||||
ifndef RC
|
|
||||||
RC = i686-w64-mingw32-windres
|
|
||||||
endif
|
|
||||||
else ifneq ($(ARCH),default)
|
|
||||||
$(error [FAIL] unknown architecture $(ARCH))
|
|
||||||
endif
|
|
||||||
LDFLAGS += out/libui.dll
|
|
||||||
else ifeq ($(OS),darwin)
|
|
||||||
LDFLAGS += out/libui.dylib
|
|
||||||
else
|
|
||||||
LDFLAGS += out/libui.so
|
|
||||||
endif
|
|
||||||
|
|
||||||
include GNUbaserules.mk
|
include GNUbaserules.mk
|
||||||
|
|
|
@ -48,5 +48,3 @@ LDFLAGS += \
|
||||||
# on warning about undefined symbols:
|
# on warning about undefined symbols:
|
||||||
# the gcc flags don't work with Apple's linker
|
# the gcc flags don't work with Apple's linker
|
||||||
# fortunately, we don't need any; Apple's linker warns about undefined symbols in -shared builds!
|
# fortunately, we don't need any; Apple's linker warns about undefined symbols in -shared builds!
|
||||||
|
|
||||||
SUFFIX = .dylib
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# 16 october 2015
|
||||||
|
|
||||||
|
EXESUFFIX =
|
||||||
|
LIBSUFFIX = .dylib
|
|
@ -45,5 +45,3 @@ LDFLAGS += \
|
||||||
# flags for warning on undefined symbols
|
# flags for warning on undefined symbols
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
-Wl,--no-undefined -Wl,--no-allow-shlib-undefined
|
-Wl,--no-undefined -Wl,--no-allow-shlib-undefined
|
||||||
|
|
||||||
SUFFIX = .so
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# 16 october 2015
|
||||||
|
|
||||||
|
EXESUFFIX =
|
||||||
|
LIBSUFFIX = .so
|
|
@ -56,23 +56,3 @@ LDFLAGS += \
|
||||||
# warnings on undefined symbols
|
# warnings on undefined symbols
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
-Wl,--no-undefined -Wl,--no-allow-shlib-undefined
|
-Wl,--no-undefined -Wl,--no-allow-shlib-undefined
|
||||||
|
|
||||||
SUFFIX = .dll
|
|
||||||
|
|
||||||
ifeq ($(ARCH),amd64)
|
|
||||||
ifndef CC
|
|
||||||
CC = x86_64-w64-mingw32-gcc
|
|
||||||
endif
|
|
||||||
ifndef RC
|
|
||||||
RC = x86_64-w64-mingw32-windres
|
|
||||||
endif
|
|
||||||
else ifeq ($(ARCH),386)
|
|
||||||
ifndef CC
|
|
||||||
CC = i686-w64-mingw32-gcc
|
|
||||||
endif
|
|
||||||
ifndef RC
|
|
||||||
RC = i686-w64-mingw32-windres
|
|
||||||
endif
|
|
||||||
else ifneq ($(ARCH),default)
|
|
||||||
$(error [FAIL] unknown architecture $(ARCH))
|
|
||||||
endif
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# 16 october 2015
|
||||||
|
|
||||||
|
EXESUFFIX = .exe
|
||||||
|
LIBSUFFIX = .dll
|
||||||
|
|
||||||
|
ifeq ($(ARCH),amd64)
|
||||||
|
ifndef CC
|
||||||
|
CC = x86_64-w64-mingw32-gcc
|
||||||
|
endif
|
||||||
|
ifndef RC
|
||||||
|
RC = x86_64-w64-mingw32-windres
|
||||||
|
endif
|
||||||
|
else ifeq ($(ARCH),386)
|
||||||
|
ifndef CC
|
||||||
|
CC = i686-w64-mingw32-gcc
|
||||||
|
endif
|
||||||
|
ifndef RC
|
||||||
|
RC = i686-w64-mingw32-windres
|
||||||
|
endif
|
||||||
|
else ifneq ($(ARCH),default)
|
||||||
|
$(error [FAIL] unknown architecture $(ARCH))
|
||||||
|
endif
|
Loading…
Reference in New Issue