Use an absolute directory in /usr/share/games/ for game data
[kball.git] / makefile.all
blobc1b8ae960108c2d49922b30db46f954637f4beca
1 # KBall Makefile
2 # Thanks to Schwarzung for help.
3 # Copyright (c) 2003-2005, Kronoman
5 TEMP = $(wildcard $(SRCDIR)/*$(SRCSUF))
6 FILES = $(if $(TEMP), $(TEMP), $(error No source code found!))
7 OBJS = $(addprefix $(OBJDIR)/,$(addsuffix $(OBJSUF), $(basename $(notdir $(FILES) ) ) ) )
9 # main target, all project
10 .PHONY: all
11 all: $(BINDIR)/$(BINARY)$(BINSUF)
13 $(BINDIR)/$(BINARY)$(BINSUF) : $(OBJS) 
14         $(GCC) $^ -o $@ $(LFLAGS)
15         @echo The $(BINDIR)/$(BINARY)$(BINSUF) is ready!
17 $(OBJDIR)/%$(OBJSUF) : $(SRCDIR)/%$(SRCSUF)
18         $(GCC) $(CFLAGS) -c $< -o $@
20 .PHONY: clean and also clean the test
21 clean: cleantest
22         rm -rf $(BINDIR)/$(BINARY)$(BINSUF) $(OBJS)
24 # Strip symbols and compress with upx packer (http://upx.sf.net/)
25 .PHONY: upx
26 upx:
27         strip --strip-all $(BINDIR)/$(BINARY)$(BINSUF)
28         upx --best $(BINDIR)/$(BINARY)$(BINSUF)
30 # Install - Please add here your custom installation functions
31 .PHONY: install
32 install:
33         @echo Sorry, the install feature is not done yet.
35 # Test if the system can compile
36 # Compile the program
37 # The test.run is to check if make run or not in DJGPP enviroment (ugly hack)
38 # seems that DOS don't set errorlevel if fails to execute a program
39 .PHONY: test
40 test:
41         $(GCC) $(TESTFILE)$(SRCSUF) -o $(TESTFILE)$(BINSUF) $(CFLAGS) $(LFLAGS)
42         @echo "don't edit me" > test.run
44 # Cleans the test
45 .PHONY: cleantest
46 cleantest: 
47         rm -rf $(TESTFILE)$(BINSUF) test.run