Wed Apr 17 01:05:42 PDT 2002
[netwalk.git] / Makefile
blob58c562ebdb02310478cc018cd97d43d8ffaf05bc
1 ALLFILES = ext_sdl.c bl*.[ch] version.h *.e Makefile LICENSE README HISTORY *.config *.se cross.ed
3 ifdef WIN32
4 CC = i586-mingw32msvc-gcc
5 EFLAGS=-boost -O2 -I /home/ben/cross/SDL/include/SDL
6 CFLAGS=-O2 -Wall -I /home/ben/cross/SDL/include/SDL
7 SDL_LIBS=-L /home/ben/cross/SDL/lib -lSDL
8 LIBS = $(SDL_LIBS) -lSDL_ttf
9 else
10 CC = gcc
11 CFLAGS=-O2 -Wall `sdl-config --cflags`
12 EFLAGS=-boost -O2 `sdl-config --cflags`
13 SDL_LIBS=`sdl-config --libs`
14 LIBS = $(SDL_LIBS) -lSDL_ttf
15 endif
17 target : netwalk
19 bl_lib.o : bl_lib.c
21 netwalk : *.e ext_sdl.c bl_lib.o
22 ifdef WIN32
23 compile_to_c -cecil cecil.se -o $@.exe netwalk $(EFLAGS) ext_sdl.c bl_lib.o $(LIBS)
24 ed -s netwalk.make < cross.ed
25 . netwalk.make
26 else
27 compile -cecil cecil.se $(EFLAGS) -o $@ netwalk ext_sdl.c bl_lib.o $(LIBS)
28 endif
30 clean :
31 -rm netwalk *.o
32 clean netwalk
34 projname := $(shell awk '/NETWALK_VERSION/ { print $$3 }' version.h )
36 dist: $(ALLFILES)
37 -rm -rf $(projname)
38 mkdir $(projname)
39 cp -rl --parents $(ALLFILES) $(projname)
40 tar chfz $(projname).tgz $(projname)
41 -rm -rf $(projname)
43 ifdef WIN32
44 windist : netwalk
45 -rm -rf $(projname)
46 mkdir $(projname)
47 cp -l netwalk.exe $(projname)
48 cp -l linux.config $(projname)/config
49 cp -l /home/ben/cross/SDL/lib/SDL.dll $(projname)
50 cp -l /home/ben/cross/SDL/lib/SDL_ttf.dll $(projname)
51 zip $(projname)-win.zip $(projname)/*
52 -rm -rf $(projname)
53 endif