File: Makefile

package info (click to toggle)
syslinux 3%3A6.04~git20190206.bf6db5b4%2Bdfsg1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,020 kB
  • sloc: ansic: 189,354; asm: 5,148; pascal: 4,825; makefile: 1,981; perl: 1,980; python: 266; sh: 185; xml: 39
file content (71 lines) | stat: -rw-r--r-- 1,383 bytes parent folder | download | duplicates (7)
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
#
# OpenWatcom compile and link utility
#
VPATH = $(SRC)
include $(MAKEDIR)/syslinux.mk

WCL	= wcl
WCLOPT	= -6 -osx -mt -bt=DOS -l=COM

WCL_IS_GOOD := $(shell $(WCL) $(WCLOPT) \
        -o hello.exe $(SRC)/../win/hello.c >/dev/null 2>&1 ; echo $$?)

UPX     = upx

NASM    = nasm
NASMOPT = -Ox

WCTARGETS = mdiskchk.com
NSTARGETS = eltorito.sys copybs.com
WCOBJS    = $(addprefix $(SRC)/,$(WCTARGETS))
NSOBJS    = $(addprefix $(OBJ)/,$(NSTARGETS))
TARGETS   = $(WCTARGETS) $(NSTARGETS)

%.obj: %.c
	$(WCL) $(WCLOPT) -c -fo=$@ $<

%.com: %.obj
	$(WCL) $(WCLOPT) -fe=$@ $<
	$(UPX) --ultra-brute --lzma $@ || \
		$(UPX) --ultra-brute $@ || \
		true
	rm -f $*.0*
	chmod a-x $@

%.sys: %.asm
	$(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
	$(UPX) --ultra-brute --lzma $@ || \
		$(UPX) --ultra-brute $@ || \
		true
	rm -f $*.0*
	chmod a-x $@

%.com: %.asm
	$(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
	$(UPX) --ultra-brute --lzma $@ || \
		$(UPX) --ultra-brute $@ || \
		true
	rm -f $*.0*
	chmod a-x $@

ifeq ($(WCL_IS_GOOD),0)
all: $(TARGETS)
else
all: $(NSTARGETS)
	rm -f $(WCTARGETS)
endif

tidy dist:
	-rm -f *.obj *.lst *.o *.0*

clean: tidy

spotless: clean
	-rm -f $(NSTARGETS) *~

installer: all

install: installer
	mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)/dosutil
	install -m 644 $(WCOBJS) $(INSTALLROOT)$(AUXDIR)/dosutil
	install -m 644 $(NSOBJS) $(INSTALLROOT)$(AUXDIR)/dosutil