-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk_os2.mak
104 lines (85 loc) · 2.63 KB
/
mk_os2.mak
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# $Id: mk_os2.mak 74 2002-01-27 21:20:55Z darren $
#
# A Makefile for OS/2 using EMX/gcc
# You may want to use the OS/2 port of autoconf for building
# and comment-out the according statements in this Makefile.
# You need a library to provide regex support.
# libExt might do this, but currently (2/2001) it doesn't work well
# together with ctags ...
#
# Provided and supported by
# Alexander Mai
# <st002279@hrzpub.tu-darmstadt.de> or <amai@users.sf.net>
default:
@echo "Enter $(MAKE) -f mk_os2.mak target"
@echo "where target is one of:"
@echo " small (small executable req. EMX runtime)"
@echo " debug (executable for debugging purposes)"
@echo " release (stand-alone executable)"
@echo " clean (remove all files built)"
# Use this to create a small binary
# (requires EMX runtime libraries)
small:
$(MAKE) -f mk_os2.mak all \
CC="gcc" \
CFLAGS="-O5 -mpentium -Wall" \
LFLAGS="-Zcrtdll -s" \
LIBS="-lregex" \
OBJEXT="o"
# Use this to create a binary for debugging purposes
# (requires EMX runtime libraries)
debug:
$(MAKE) -f mk_os2.mak all \
CC="gcc" \
CFLAGS="-O0 -Wall -g" \
LFLAGS="-Zcrtdll -g" \
LIBS="-lregex" \
OBJEXT="o"
# Use this to create a stand-alone binary for distribution
# (requires link386 for linking but no EMX runtime libraries)
release:
$(MAKE) -f mk_os2.mak all \
CC="gcc" \
CFLAGS="-g -O5 -mpentium -Wall" \
LFLAGS="-s -Zomf -Zsys -Zlinker /PM:VIO" \
LIBS="-lregex" \
OBJEXT="obj"
# Use the line below if you have created config.h
# (manually or by running configure)
# Otherwise use built-in defaults (#ifdef OS2)!
# DEFINES=-DHAVE_CONFIG_H
DEFINES=-DOS2
# General rules and definitions
.SUFFIXES: .c .exe .h .o .obj
include source.mak
all: ctags.exe readtags.exe readtags.a readtags.lib
ctags: ctags.exe
etags: etags.exe
ctags.exe: $(OBJECTS)
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $^ $(LIBS)
etags.exe: ctags.exe
@copy $< $@
# The readtags executable
readtags.exe: readtags.c
$(CC) $(CFLAGS) $(DEFINES) $(LFLAGS) -DREADTAGS_MAIN -o $@ $^ $(LIBS)
# We build a.out and omf version of the readtags library
readtags.o: readtags.c
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $^
readtags.a: readtags.o
if exist $@ del $@
ar rc $@ $^
readtags.lib: readtags.a
emxomf $<
.c.o:
$(CC) $(CFLAGS) $(DEFINES) -I. -c $< -o $@
.c.obj:
$(CC) $(CFLAGS) -Zomf $(DEFINES) -I. -c $< -o $@
# Delete all files that are not part of the source distribution
clean:
@if exist ctags.exe del ctags.exe
@if exist etags.exe del etags.exe
@if exist readtags.exe del readtags.exe
@if exist readtags.a del readtags.a
@if exist readtags.lib del readtags.lib
@if exist *.obj del *.obj
@if exist *.o del *.o