mirror of
https://github.com/Vita3K/unicorn.git
synced 2024-11-23 21:39:44 +00:00
revert the change on verbose option for Makefile
This commit is contained in:
parent
2a4c316b6f
commit
ab9bae4f3e
16
Makefile
16
Makefile
@ -211,12 +211,28 @@ qemu/config-host.h-timestamp:
|
|||||||
unicorn: $(LIBRARY) $(ARCHIVE)
|
unicorn: $(LIBRARY) $(ARCHIVE)
|
||||||
|
|
||||||
$(LIBRARY): qemu/config-host.h-timestamp uc.o list.o
|
$(LIBRARY): qemu/config-host.h-timestamp uc.o list.o
|
||||||
|
ifeq ($(UNICORN_SHARED),yes)
|
||||||
|
ifeq ($(V),0)
|
||||||
|
$(call log,GEN,$(LIBRARY))
|
||||||
|
@$(CC) $(CFLAGS) -shared $(UC_TARGET_OBJ) uc.o list.o -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
|
||||||
|
@-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
|
||||||
|
else
|
||||||
$(CC) $(CFLAGS) -shared $(UC_TARGET_OBJ) uc.o list.o -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
|
$(CC) $(CFLAGS) -shared $(UC_TARGET_OBJ) uc.o list.o -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
|
||||||
-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
|
-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
$(ARCHIVE): qemu/config-host.h-timestamp uc.o list.o
|
$(ARCHIVE): qemu/config-host.h-timestamp uc.o list.o
|
||||||
|
ifeq ($(UNICORN_STATIC),yes)
|
||||||
|
ifeq ($(V),0)
|
||||||
|
$(call log,GEN,$(ARCHIVE))
|
||||||
|
@$(AR) q $(ARCHIVE) $(UC_TARGET_OBJ) uc.o list.o
|
||||||
|
@$(RANLIB) $(ARCHIVE)
|
||||||
|
else
|
||||||
$(AR) q $(ARCHIVE) $(UC_TARGET_OBJ) uc.o list.o
|
$(AR) q $(ARCHIVE) $(UC_TARGET_OBJ) uc.o list.o
|
||||||
$(RANLIB) $(ARCHIVE)
|
$(RANLIB) $(ARCHIVE)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
$(PKGCFGF):
|
$(PKGCFGF):
|
||||||
$(generate-pkgcfg)
|
$(generate-pkgcfg)
|
||||||
|
@ -10,11 +10,13 @@ ifndef GLIB
|
|||||||
GLIB = $(shell pkg-config --libs glib-2.0)
|
GLIB = $(shell pkg-config --libs glib-2.0)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BIN_EXT =
|
||||||
|
|
||||||
# Verbose output?
|
# Verbose output?
|
||||||
V ?= 0
|
V ?= 0
|
||||||
|
|
||||||
CFLAGS += -Wall -Werror -I../include
|
CFLAGS += -Wall -Werror -I../include
|
||||||
LDFLAGS += -L..
|
LDFLAGS += -L.. -lunicorn
|
||||||
LDLIBS += -lpthread -lunicorn -lm $(GLIB)
|
LDLIBS += -lpthread -lunicorn -lm $(GLIB)
|
||||||
|
|
||||||
ifneq ($(CROSS),)
|
ifneq ($(CROSS),)
|
||||||
@ -32,9 +34,11 @@ endif
|
|||||||
ifneq ($(filter CYGWIN%,$(UNAME_S)),)
|
ifneq ($(filter CYGWIN%,$(UNAME_S)),)
|
||||||
CFLAGS := $(CFLAGS:-fPIC=)
|
CFLAGS := $(CFLAGS:-fPIC=)
|
||||||
LDLIBS += -lssp
|
LDLIBS += -lssp
|
||||||
|
BIN_EXT = .exe
|
||||||
# mingw?
|
# mingw?
|
||||||
else ifneq ($(filter MINGW%,$(UNAME_S)),)
|
else ifneq ($(filter MINGW%,$(UNAME_S)),)
|
||||||
CFLAGS := $(CFLAGS:-fPIC=)
|
CFLAGS := $(CFLAGS:-fPIC=)
|
||||||
|
BIN_EXT = .exe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
@ -69,9 +73,66 @@ ifneq (,$(findstring m68k,$(UNICORN_ARCHS)))
|
|||||||
SOURCES += sample_m68k.c
|
SOURCES += sample_m68k.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BINS = $(SOURCES:.c=)
|
BINS = $(SOURCES:.c=$(BIN_EXT))
|
||||||
|
OBJS = $(SOURCES:.c=.o)
|
||||||
|
|
||||||
all: $(BINS)
|
all: $(BINS)
|
||||||
|
|
||||||
|
$(BINS): $(OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf *.o $(BINS)
|
rm -rf *.o $(BINS)
|
||||||
|
|
||||||
|
%$(BIN_EXT): %.o
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
ifeq ($(V),0)
|
||||||
|
ifeq ($(UNICORN_SHARED),yes)
|
||||||
|
$(call log,LINK,$(notdir $@))
|
||||||
|
@$(link-dynamic)
|
||||||
|
endif
|
||||||
|
ifeq ($(UNICORN_STATIC),yes)
|
||||||
|
ifneq ($(filter MINGW%,$(UNAME_S)),)
|
||||||
|
$(call log,LINK,$(notdir $(call staticname,$@)))
|
||||||
|
@$(link-static)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifeq ($(UNICORN_SHARED),yes)
|
||||||
|
$(link-dynamic)
|
||||||
|
endif
|
||||||
|
ifeq ($(UNICORN_STATIC),yes)
|
||||||
|
ifneq ($(filter MINGW%,$(UNAME_S)),)
|
||||||
|
$(link-static)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
ifeq ($(V),0)
|
||||||
|
$(call log,CC,$(@:%=%))
|
||||||
|
@$(compile)
|
||||||
|
else
|
||||||
|
$(compile)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
define link-dynamic
|
||||||
|
$(CC) $< $(LDFLAGS) -o $@
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
define link-static
|
||||||
|
$(CC) $< $(ARCHIVE) $(LDFLAGS_STATIC) -o $(call staticname,$@)
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
staticname = $(subst $(BIN_EXT),,$(1)).static$(BIN_EXT)
|
||||||
|
|
||||||
|
define log
|
||||||
|
@printf " %-7s %s\n" "$(1)" "$(2)"
|
||||||
|
endef
|
||||||
|
|
||||||
|
define compile
|
||||||
|
${CC} ${CFLAGS} -c $< -o $@
|
||||||
|
endef
|
||||||
|
Loading…
Reference in New Issue
Block a user