Skip to content

Commit 6c2026e

Browse files
committed
Split Makefile
1 parent 0fb1a17 commit 6c2026e

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

Makefile

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,4 @@
1-
ARCH := $(shell uname -m)
2-
ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
3-
ARCH := i386
4-
endif
5-
6-
ifdef LIBX86EMU_VERSION
7-
VERSION := $(shell echo ${LIBX86EMU_VERSION} > VERSION; cat VERSION)
8-
else
9-
GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
10-
VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
11-
endif
12-
GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
13-
BRANCH := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
14-
PREFIX := libx86emu-$(VERSION)
15-
16-
MAJOR_VERSION := $(shell cut -d . -f 1 VERSION)
17-
18-
CC = gcc
19-
CFLAGS = -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
20-
LDFLAGS =
21-
22-
LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
23-
LIBX86 = libx86emu
24-
25-
CFILES = $(wildcard *.c)
26-
OBJS = $(CFILES:.c=.o)
27-
28-
LIB_NAME = $(LIBX86).so.$(VERSION)
29-
LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)
1+
include config.mk
302

313
.PHONY: all shared install uninstall test demo clean distclean
324

@@ -88,4 +60,3 @@ ifneq "$(MAKECMDGOALS)" "clean"
8860
@$(CC) -MG -MM $(CFLAGS) $(CFILES) >$@
8961
-include .depend
9062
endif
91-

config.mk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARCH := $(shell uname -m)
2+
ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
3+
ARCH := i386
4+
endif
5+
6+
ifdef LIBX86EMU_VERSION
7+
VERSION := $(shell echo ${LIBX86EMU_VERSION} > VERSION; cat VERSION)
8+
else
9+
GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
10+
VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
11+
endif
12+
GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
13+
BRANCH := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
14+
PREFIX := libx86emu-$(VERSION)
15+
16+
MAJOR_VERSION := $(shell cut -d . -f 1 VERSION)
17+
18+
CC = gcc
19+
CFLAGS = -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
20+
LDFLAGS =
21+
22+
LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
23+
LIBX86 = libx86emu
24+
25+
CFILES = $(wildcard *.c)
26+
OBJS = $(CFILES:.c=.o)
27+
28+
LIB_NAME = $(LIBX86).so.$(VERSION)
29+
LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)

0 commit comments

Comments
 (0)