42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
# Makefile -- KPJOY.DRV, built on Linux with Open Watcom v2's 16-bit Windows
|
|
# target (the copy JoeyLib's installer sets up, unless WATCOM names another).
|
|
#
|
|
# make bin/kpjoy.drv
|
|
# make LOG=1 the same, logging to C:\KPJOY.LOG (see kpjoy.c)
|
|
# make clean remove obj/ and bin/
|
|
# make OBJ=DIR BIN=DIR build somewhere else (an installer's build tree)
|
|
#
|
|
# Compiler flags: Windows target (-bt=windows) DLL (-bd), small model with
|
|
# SS != DS (-ms -zu: a driver runs on its caller's stack), Windows prolog
|
|
# for exported functions (-zw), no stack probes (-s), 286 code (-2),
|
|
# structures packed on 2 bytes as the Windows headers are (-zp2), all
|
|
# warnings, as errors (-w4 -we).
|
|
|
|
WATCOM ?= $(abspath $(CURDIR)/../joeylib/toolchains/opt/openWatcom)
|
|
export WATCOM
|
|
export PATH := $(WATCOM)/binl64:$(PATH)
|
|
|
|
CC := wcc
|
|
LINK := wlink
|
|
LOG ?= 0
|
|
CFLAGS := -q -bt=windows -bd -ms -zu -zw -s -2 -zp2 -os -w4 -we -i=$(WATCOM)/h -i=$(WATCOM)/h/win -DKPJOY_LOG=$(LOG)
|
|
|
|
OBJ ?= obj
|
|
BIN ?= bin
|
|
TARGET := $(BIN)/kpjoy.drv
|
|
|
|
all: $(TARGET)
|
|
|
|
$(OBJ)/kpjoy.obj: kpjoy.c Makefile | $(OBJ)
|
|
$(CC) $(CFLAGS) -fo=$@ kpjoy.c
|
|
|
|
$(TARGET): $(OBJ)/kpjoy.obj kpjoy.lnk | $(BIN)
|
|
$(LINK) option quiet @kpjoy.lnk name $@ file $(OBJ)/kpjoy.obj option map=$(OBJ)/kpjoy.map
|
|
|
|
$(OBJ) $(BIN):
|
|
mkdir -p $@
|
|
|
|
clean:
|
|
rm -rf $(OBJ) $(BIN)
|
|
|
|
.PHONY: all clean
|