Skip to content

Commit

Permalink
Split Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
meator committed Aug 29, 2021
1 parent cffed8b commit 1334d58
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
31 changes: 1 addition & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,4 @@
ARCH := $(shell uname -m)
ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
ARCH := i386
endif

ifdef LIBX86EMU_VERSION
VERSION := $(shell echo ${LIBX86EMU_VERSION} > VERSION; cat VERSION)
else
GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
endif
GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
BRANCH := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
PREFIX := libx86emu-$(VERSION)

MAJOR_VERSION := $(shell cut -d . -f 1 VERSION)

CC = gcc
CFLAGS = -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
LDFLAGS =

LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
LIBX86 = libx86emu

CFILES = $(wildcard *.c)
OBJS = $(CFILES:.c=.o)

LIB_NAME = $(LIBX86).so.$(VERSION)
LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)
include config.mk

.PHONY: all shared install uninstall test demo clean distclean

Expand Down Expand Up @@ -88,4 +60,3 @@ ifneq "$(MAKECMDGOALS)" "clean"
@$(CC) -MG -MM $(CFLAGS) $(CFILES) >$@
-include .depend
endif

29 changes: 29 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARCH := $(shell uname -m)
ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
ARCH := i386
endif

ifdef LIBX86EMU_VERSION
VERSION := $(shell echo ${LIBX86EMU_VERSION} > VERSION; cat VERSION)
else
GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
endif
GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
BRANCH := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
PREFIX := libx86emu-$(VERSION)

MAJOR_VERSION := $(shell cut -d . -f 1 VERSION)

CC = gcc
CFLAGS = -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
LDFLAGS =

LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
LIBX86 = libx86emu

CFILES = $(wildcard *.c)
OBJS = $(CFILES:.c=.o)

LIB_NAME = $(LIBX86).so.$(VERSION)
LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)

0 comments on commit 1334d58

Please sign in to comment.