summaryrefslogtreecommitdiff
path: root/Makefile
blob: ae5be06c38c41ebafbaa0a58bcc9b9705e0568d6 (plain)
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
57
58
59
60
PREFIX := /usr/local
BIN_DIR := $(PREFIX)/bin

ifdef PCC
PCC_CFLAGS=-D__float128="long double"
else
PCC_CFLAGS=
endif

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 $(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)

%.o : %.c
	$(CC) -c $< -o $@ $(CFLAGS)
clean :
	rm -f $(OBJ_NAME) $(OBJ_NAME2) *.o
install :
	install -D -m755 $(OBJ_NAME) $(BIN_DIR)/$(OBJ_NAME)
uninstall :
	rm -f $(BIN_DIR)/$(OBJ_NAME)