summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-05-03 15:51:57 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-05-03 15:51:57 -0400
commit1c622005c289ef1cd9feea277bd0ff46b19d15f0 (patch)
treeb5258bd461ac2070c39e0eb437da676a10e295c3 /Makefile
parented88644ded82008577804c590bec7188ef0da011 (diff)
Put the instruction, and I/O routines into separate
functions. I did this to make it more readable, while still making it fast, due to inlining it.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile57
1 files changed, 40 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index d8ca322..ae5be06 100644
--- a/Makefile
+++ b/Makefile
@@ -7,30 +7,53 @@ else
PCC_CFLAGS=
endif
-CFLAGS = $(PCC_CFLAGS) $(CFLAGS_EXTRA)
-OBJS = sux.o asmmon.o lexer.o
+IO=1
+
+ifdef BENCH
+BENCH_CFLAGS=-Dbench=1
+IO=
+else
+BENCH_CFLAGS=-Dbench=0
+IO=1
+endif
+
+ifdef DEBUG
+DBG_CFLAGS=-Ddebug=1
+IO=
+DBG_OBJ=disasm.o
+else
+ifdef IO
+IO=1
+endif
+DBG_CFLAGS=-Ddebug=0
+DBG_OBJ=
+endif
+
+ifdef IO
+IO_CFLAGS=-DIO=1
+else
+IO_CFLAGS=-DIO=0
+endif
+
+
+OBJS = sux.o opcode.o io.o $(DBG_OBJ) asmmon.o lexer.o
+
+CFLAGS = $(PCC_CFLAGS) $(DBG_CFLAGS) $(IO_CFLAGS) $(BENCH_CFLAGS) $(CFLAGS_EXTRA)
OBJS2 = subasm.o subeditor.o
OBJ_NAME = cisc-0.2
OBJ_NAME2 = subeditor-c
-all : clean clean_subeditor $(OBJ_NAME)
-subeditor : clean_subeditor $(OBJS2)
+
+all : clean $(OBJ_NAME)
+
+subeditor : clean $(OBJS2)
$(CC) $(OBJS2) $(CFLAGS) -lcurses -ltinfo -o $(OBJ_NAME2)
cisc-0.2: $(OBJS)
$(CC) $(OBJS) $(CFLAGS) -lpthread -lcurses -ltinfo -o $(OBJ_NAME)
-sux.o :
- $(CC) sux.c -c $(CFLAGS) -o sux.o
-asmmon.o :
- $(CC) asmmon.c -c $(CFLAGS) -o asmmon.o
-lexer.o :
- $(CC) lexer.c -c $(CFLAGS) -o lexer.o
-subasm.o :
- $(CC) programs/c-ports/subasm.c -c $(CFLAGS) -o subasm.o
-subeditor.o :
- $(CC) programs/c-ports/subeditor.c -c $(CFLAGS) -o subeditor.o
+
+%.o : %.c
+ $(CC) -c $< -o $@ $(CFLAGS)
clean :
- rm -f $(OBJ_NAME) $(OBJ_NAME2) $(OBJS) $(OBJS2)
-clean_subeditor :
- rm -f $(OBJ_NAME2) $(OBJS2)
+ rm -f $(OBJ_NAME) $(OBJ_NAME2) *.o
install :
install -D -m755 $(OBJ_NAME) $(BIN_DIR)/$(OBJ_NAME)
uninstall :