aboutsummaryrefslogtreecommitdiff
path: root/msdos/common.dj
blob: dacfd1fdfcc4ecce92761718b83af553de8750b1 (plain) (blame)
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
79
80
81
82
83
84
85
86
#
# Common defines for libpcap and 16/32-bit network drivers (djgpp)
#

.SUFFIXES: .exe .wlm .dxe .l .y
.PHONY:    check_gcclib

default: check_gcclib all

#
# This value is normally not important. Used by 'dxe3gen' in
# msdos/pm_drvr/makefile.dj to make "dynamically loaded modules".
# But this is not finished.
#
#GCC_LIB  = $(shell gcc -print-libgcc-file-name)
GCC_LIB  = .
MAKEFILE = Makefile.dj

#
# DLX 2.91+ lib. Change path to suite.
# Not used anymore. Uses DXE3 now.
#
# DLX_LIB  = $(DJDIR)/contrib/dlx.291/libdlx.a
# DLX_LINK = $(DJDIR)/bin/dlxgen.exe

WATT32_ROOT = $(subst \,/,$(WATT_ROOT))

OBJ_DIR = djgpp.obj

ifeq ($(wildcard $(GCC_LIB)),)
check_gcclib:
	@echo libgcc.a not found. Set \"$(GCC_LIB)\" to \"/djgpp/lib/gcc/djgpp/4.X/libgcc.a\"
endif


#
# Include 32-bit driver support
#
USE_32BIT_DRIVERS = 0

#
# Use loadable driver modules instead of statically linking
# all drivers.
#
USE_32BIT_MODULES = 0

#
# Put interrupt sensitive code/data in locked sections
# Do `make clean' in all affected directories after changing this.
#
USE_SECTION_LOCKING = 0

#
# Set to 1 to use exception handler lib (only for me)
#
USE_EXCEPT = 0

CC   = gcc.exe
LD   = ld.exe
ASM  = nasm.exe -fbin -dDEBUG
YACC = bison.exe
LEX  = flex.exe

CFLAGS = -g -O2 -Wall -I. -I$(WATT32_ROOT)/inc

ifeq ($(USE_EXCEPT),1)
  CFLAGS += -DUSE_EXCEPT
  EXC_LIB = d:/prog/mw/except/lib/libexc.a
endif

ifeq ($(USE_SECTION_LOCKING),1)
  CFLAGS += -DUSE_SECTION_LOCKING
endif

ifeq ($(USE_32BIT_DRIVERS),1)
  CFLAGS += -DUSE_32BIT_DRIVERS
endif

%.o: %.c
	$(CC) -c $(CFLAGS) -o $@ $<
	@echo

%.o: %.s
	$(CC) -c $(CFLAGS) -x assembler-with-cpp -o $@ $<
	@echo