add rtdisasm target to makefile since I'm gonna implement runtime disassembler
This commit is contained in:
parent
a1b815415e
commit
359e745370
3 changed files with 18 additions and 2 deletions
15
Makefile
15
Makefile
|
|
@ -2,19 +2,27 @@ INC_DIR = include
|
|||
SRC_DIR = src
|
||||
OBJ_DIR = obj
|
||||
BIN_DIR = bin
|
||||
LIB_DIR = bin
|
||||
|
||||
CC = gcc
|
||||
AS = as
|
||||
AR = ar
|
||||
LD = ld
|
||||
CFLAGS = -Wall -I$(INC_DIR)
|
||||
ASFLAGS =
|
||||
LDFLAGS = -z noexecstack -lcap
|
||||
|
||||
RTDISASM_SRC = rtdisasm.c
|
||||
RTDISASM_OBJ := $(addprefix $(OBJ_DIR)/,$(patsubst %.s,%.o,$(patsubst %.c,%.o,$(RTDISASM_SRC))))
|
||||
RTDISASM_SRC := $(addprefix $(SRC_DIR)/,$(RTDISASM_SRC))
|
||||
RTDISASM_DEPS = rtdisasm.h
|
||||
RTDISASM_DEPS := $(addprefix $(INC_DIR)/,$(RTDISASM_DEPS))
|
||||
|
||||
BLACKJACK_SRC = main.c process.c
|
||||
BLACKJACK_OBJ := $(addprefix $(OBJ_DIR)/,$(patsubst %.s,%.o,$(patsubst %.c,%.o,$(BLACKJACK_SRC))))
|
||||
BLACKJACK_SRC := $(addprefix $(SRC_DIR)/,$(BLACKJACK_SRC))
|
||||
BLACKJACK_DEPS = debug.h process.h
|
||||
BLACKJACK_DEPS := $(addprefix $(INC_DIR)/,$(BLACKJACK_DEPS))
|
||||
BLACKJACK_DEPS := $(addprefix $(INC_DIR)/,$(BLACKJACK_DEPS)) rtdisasm
|
||||
|
||||
DUMMY_TARGET_SRC = dummy_target.c dummy_destination.s
|
||||
DUMMY_TARGET_OBJ := $(addprefix $(OBJ_DIR)/,$(patsubst %.s,%.o,$(patsubst %.c,%.o,$(DUMMY_TARGET_SRC))))
|
||||
|
|
@ -26,8 +34,11 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
|
|||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.s
|
||||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
rtdisasm: $(RTDISASM_OBJ) $(RTDISASM_DEPS)
|
||||
$(AR) -crs $(BIN_DIR)/librtdisasm.a $(RTDISASM_OBJ)
|
||||
|
||||
blackjack: $(BLACKJACK_OBJ) $(BLACKJACK_DEPS)
|
||||
$(CC) $(LDFLAGS) -o $(BIN_DIR)/$@ $(BLACKJACK_OBJ)
|
||||
$(CC) $(LDFLAGS) $(LIB_DIR)/librtdisasm.a -o $(BIN_DIR)/$@ $(BLACKJACK_OBJ)
|
||||
|
||||
dummy_target: $(DUMMY_TARGET_OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(BIN_DIR)/$@ $(DUMMY_TARGET_OBJ)
|
||||
|
|
|
|||
4
include/rtdisasm.h
Normal file
4
include/rtdisasm.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef __RTDISASM_H
|
||||
#define __RTDISASM_H
|
||||
|
||||
#endif
|
||||
1
src/rtdisasm.c
Normal file
1
src/rtdisasm.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "rtdisasm.h"
|
||||
Loading…
Add table
Reference in a new issue