makefile
2.17 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
BASE = ..
include $(BASE)/port.mak
CFLAGS = -O2 $(WARNING_FLAGS) -g -I$(INCDIR) -Iinclude -DTARGET_$(TARGET)
CXXFLAGS = $(CFLAGS)
CORE = core channels config conns lists connhelp timer fixaddr classes drivers threads wait address
DRIVERS = nonet wsockdos internet template ipx ipxsocks serial serdos serlinux local inetaddr
# Not a pleasant solution
DRIVERS += $(PLATFORM_DRIVERS)
CORE_OBJS = $(addprefix core/, $(addsuffix .o, $(CORE)))
DRIVER_OBJS = $(addprefix drivers/, $(addsuffix .o, $(DRIVERS)))
.PHONY: all lib install clean cleaner veryclean rebuild reinstall
.PRECIOUS: %/%.o
all: lib
lib: $(LIBSRC) $(INCSRC)
install: $(LIBDEST) $(INCDEST)
$(LIBDEST): $(LIBSRC)
@echo "Copying $(LIBFILENAME) to library directory..."
$(CP_F) $< $@
$(INCDEST): $(INCSRC)
@echo "Copying $(INCNAME) to include directory..."
$(CP_F) $< $@
$(LIBSRC): $(CORE_OBJS) $(DRIVER_OBJS)
@echo "Updating library..."
$(AR) $(ARFLAGS) $@ $^
# General dependencies
$(CORE_OBJS): $(INCSRC) include/internal.h include/drivers.h
$(DRIVER_OBJS): $(INCSRC) include/internal.h include/config.h include/platdefs.h
# Specific dependencies
core/channels.o: include/channels.h include/drivers.h
core/config.o: include/config.h include/drivers.h
core/connhelp.o: include/config.h include/connhelp.h include/platdefs.h include/timer.h
core/conns.o: include/conns.h include/drivers.h include/timer.h
core/core.o: include/channels.h include/connhelp.h include/conns.h include/drivers.h
core/threads.o: include/threads.h
drivers/ipx.o: include/types.h
drivers/local.o: include/types.h include/threads.h
drivers/serbeos.o: include/serial.h
drivers/serdos.o: include/serial.h include/serdos.h
drivers/serial.o: include/serial.h
drivers/serlinux.o: include/serial.h
drivers/internet.o: include/inetaddr.h include/inetdefs.h
drivers/inetaddr.o: include/inetaddr.h include/inetdefs.h
drivers/wsockdos.o: include/dns.h include/inetaddr.h include/wsockdos.h
clean:
@echo "Cleaning..."
$(RM_F) $(CORE_OBJS) $(DRIVER_OBJS)
cleaner: clean
@echo "Scrubbing..."
$(RM_F) $(LIBSRC)
veryclean: cleaner
@echo "Eradicating..."
$(RM_F) $(LIBDEST)
$(RM_F) $(INCDEST)
rebuild: veryclean all
reinstall: veryclean install