summaryrefslogtreecommitdiff
path: root/Makefile-optimized
blob: ab5a7c561bc3d6ea2f73e4dca33c28ac88dd11fb (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
# $Id$

CC = gcc -pipe
PACKETDEF = -DPACKETVER=5 -DNEW_006b
#PACKETDEF = -DPACKETVER=4 -DNEW_006b
#PACKETDEF = -DPACKETVER=3 -DNEW_006b
#PACKETDEF = -DPACKETVER=2 -DNEW_006b
#PACKETDEF = -DPACKETVER=1 -DNEW_006b

PLATFORM = $(shell uname)

ifeq ($(findstring FreeBSD,$(PLATFORM)), FreeBSD)
MAKE = gmake
else
MAKE = make
endif

ifeq ($(findstring CYGWIN,$(PLATFORM)), CYGWIN)
OS_TYPE = -DCYGWIN
CFLAGS = -O2 -Wall -DFD_SETSIZE=4096 -I../common $(PACKETDEF) $(OS_TYPE)
else
OS_TYPE =
CFLAGS = -O2 -Wall -I../common $(PACKETDEF) $(OS_TYPE)
endif

MKDEF = CC="$(CC)" CFLAGS="$(CFLAGS)"


all clean: src/common/GNUmakefile src/login/GNUmakefile src/char_unblocked/GNUmakefile src/map/GNUmakefile src/ladmin/GNUmakefile
	cd src ; cd common ; $(MAKE) $(MKDEF) $@ ; cd ..
	cd src ; cd login ; $(MAKE) $(MKDEF) $@ ; cd ..
	cd src ; cd char_unblocked ; $(MAKE) $(MKDEF) $@ ; cd ..
	cd src ; cd map ; $(MAKE) $(MKDEF) $@ ; cd ..
	cd src ; cd ladmin ; $(MAKE) $(MKDEF) $@ ; cd ..

tools:
	cd tool && $(MAKE) $(MKDEF) && cd ..
	$(CC) -o setupwizard setupwizard.c	

src/common/GNUmakefile: src/common/Makefile
	sed -e 's/$$>/$$^/' src/common/Makefile > src/common/GNUmakefile
src/login/GNUmakefile: src/login/Makefile
	sed -e 's/$$>/$$^/' src/login/Makefile > src/login/GNUmakefile
src/char_unblocked/GNUmakefile: src/char_unblocked/Makefile
	sed -e 's/$$>/$$^/' src/char_unblocked/Makefile > src/char_unblocked/GNUmakefile
src/map/GNUmakefile: src/map/Makefile
	sed -e 's/$$>/$$^/' src/map/Makefile > src/map/GNUmakefile
src/ladmin/GNUmakefile: src/ladmin/Makefile
	sed -e 's/$$>/$$^/' src/ladmin/Makefile > src/ladmin/GNUmakefile