Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 64fe1e1782
Fetching contributors…

Cannot retrieve contributors at this time

file 56 lines (47 sloc) 1.779 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
CC = gcc
CXX = g++
CFLAGS = -Wall -pedantic -std=gnu99 # I hate pedantic # -pedantic-errors # The unistd.h has some errors with pedantic, not our fault
LDFLAGS =

NAME = ASMash
LIB = asmash
SRCDIR = src
INCLUDEDIR = include
PREFIX = /usr
FILES = ${SRCDIR}/Bytecode.o ${SRCDIR}/Instruction.o ${SRCDIR}/InstructionList.o ${SRCDIR}/InstructionStream.o \
${SRCDIR}/Arch/api.o \
${SRCDIR}/Arch/IA32/api.o ${SRCDIR}/Arch/IA32/opcodes.o \
${SRCDIR}/Format/api.o ${SRCDIR}/Format/ELF/api.o

## ARCHS ##
ARCH_IA32 = 0

ARCH = ${ARCH_IA32}

ifeq (${DEBUG}, 1)
CFLAGS += -g3
endif

all: $(FILES)
${CC} ${LDFLAGS} -dynamiclib -shared -Wl,-soname,lib${LIB}.so.0 -o lib${LIB}.so.0.0.0 $(FILES:.o=.lo)
ar rcs lib$(LIB).a $(FILES:.o=.lo)

$(FILES): $(FILES:.o=.c)
${CC} ${CFLAGS} -DAA_DEFAULT_ARCH='${ARCH}' -I./include/ -I./src/ -fPIC -c $*.c -o $*.lo

install:
mkdir -p $(PREFIX)/lib
mkdir -p $(PREFIX)/doc
mkdir -p $(PREFIX)/doc/$(LIB)-$(shell cat VERSION)
mkdir -p $(PREFIX)/$(INCLUDEDIR)/ASMash
install -m 0644 README $(PREFIX)/doc/$(LIB)-$(shell cat VERSION)
install -m 0644 INSTALL $(PREFIX)/doc/$(LIB)-$(shell cat VERSION)
install -m 0644 VERSION $(PREFIX)/doc/$(LIB)-$(shell cat VERSION)
install -m 0644 LICENCE $(PREFIX)/doc/$(LIB)-$(shell cat VERSION)
install -m 0644 $(INCLUDEDIR)/* $(PREFIX)/include/ASMash
install -m 0644 lib$(LIB).a $(PREFIX)/lib
install -m 0755 lib$(LIB).so.0.0.0 $(PREFIX)/lib
ln -sf $(PREFIX)/lib/lib$(LIB).so.0.0.0 $(PREFIX)/lib/lib$(LIB).so.0
ldconfig

clean:
find src | egrep "\.l?o$$" | xargs rm -f
rm -f lib$(LIB).a
rm -f lib$(LIB).so.*

uninstall:
rm $(PREFIX)/include/elfshark.h
rm $(PREFIX)/include/elfshark_private.h
rm $(PREFIX)/lib/lib$(LIB).so.*
rm $(PREFIX)/lib/lib$(LIB).a
Something went wrong with that request. Please try again.