mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-02-04 15:40:14 +00:00
Add building static lib to makefile and a header which includes every other header
This commit is contained in:
parent
45cb94d3cc
commit
421e740014
22
Makefile
22
Makefile
@ -5,10 +5,11 @@ ASAN ?= 0
|
||||
EXPERIMENTAL ?= 0
|
||||
|
||||
CC := clang
|
||||
AR := ar
|
||||
IINC := -I include
|
||||
CSTD := -std=c11
|
||||
CFLAGS :=
|
||||
LDFLAGS :=
|
||||
CFLAGS := -fPIC
|
||||
LDFLAGS := -Lbuild -lrabbitizer
|
||||
WARNINGS := -Wall -Wextra -Wpedantic
|
||||
# WARNINGS := -Wall -Wextra -Wpedantic -Wpadded
|
||||
WARNINGS += -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=vla -Werror=switch -Werror=implicit-fallthrough -Werror=unused-function -Werror=unused-parameter -Werror=shadow
|
||||
@ -43,6 +44,8 @@ H_FILES := $(foreach dir,$(IINC),$(wildcard $(dir)/**/*.h))
|
||||
O_FILES := $(foreach f,$(C_FILES:.c=.o),build/$f)
|
||||
DEP_FILES := $(O_FILES:%.o=%.d)
|
||||
|
||||
STATIC_LIB := build/librabbitizer.a
|
||||
DYNAMIC_LIB := build/librabbitizer.so
|
||||
|
||||
# create build directories
|
||||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
||||
@ -50,7 +53,10 @@ $(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
||||
|
||||
#### Main Targets ###
|
||||
|
||||
all: tests
|
||||
all: static tests
|
||||
|
||||
static: $(STATIC_LIB)
|
||||
dynamic: $(DYNAMIC_LIB)
|
||||
|
||||
clean:
|
||||
$(RM) -rf build
|
||||
@ -73,8 +79,14 @@ tests: build/test.elf build/rsptest.elf build/r5900test.elf build/registersTrack
|
||||
|
||||
#### Various Recipes ####
|
||||
|
||||
build/%.elf: %.c $(O_FILES)
|
||||
$(CC) -MMD $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
||||
build/%.elf: %.c | $(STATIC_LIB)
|
||||
$(CC) -MMD $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
build/%.a: $(O_FILES)
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
build/%.so: $(O_FILES)
|
||||
$(CC) -shared -o $@ $^
|
||||
|
||||
build/%.o: %.c
|
||||
# The -MMD flags additionaly creates a .d file with the same name as the .o file.
|
||||
|
20
include/rabbitizer.h
Normal file
20
include/rabbitizer.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef RABBITIZER_H
|
||||
#define RABBITIZER_H
|
||||
|
||||
#include "common/Utils.h"
|
||||
#include "common/RabbitizerConfig.h"
|
||||
|
||||
#include "instructions/RabbitizerOperandType.h"
|
||||
#include "instructions/RabbitizerInstrId.h"
|
||||
#include "instructions/RabbitizerInstrSuffix.h"
|
||||
#include "instructions/RabbitizerInstrDescriptor.h"
|
||||
#include "instructions/RabbitizerRegister.h"
|
||||
#include "instructions/RabbitizerInstruction.h"
|
||||
#include "instructions/RabbitizerInstructionRsp.h"
|
||||
#include "instructions/RabbitizerInstructionR5900.h"
|
||||
|
||||
#include "analysis/RabbitizerTrackedRegisterState.h"
|
||||
#include "analysis/RabbitizerLoPairingInfo.h"
|
||||
#include "analysis/RabbitizerRegistersTracker.h"
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user