diff --git a/Makefile b/Makefile index 6eb0623..0df91ac 100644 --- a/Makefile +++ b/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) diff --git a/include/rtdisasm.h b/include/rtdisasm.h new file mode 100644 index 0000000..6ca34b3 --- /dev/null +++ b/include/rtdisasm.h @@ -0,0 +1,4 @@ +#ifndef __RTDISASM_H +#define __RTDISASM_H + +#endif \ No newline at end of file diff --git a/src/rtdisasm.c b/src/rtdisasm.c new file mode 100644 index 0000000..1fd96c4 --- /dev/null +++ b/src/rtdisasm.c @@ -0,0 +1 @@ +#include "rtdisasm.h" \ No newline at end of file