Compilation: .o files in a subdirectory of obj/
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@289 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
b488ec9272
commit
4a3b324a52
38
Makefile
38
Makefile
@ -22,38 +22,45 @@
|
||||
# Windows specific
|
||||
ifdef COMSPEC
|
||||
DELCOMMAND = del
|
||||
MKDIR = mkdir /s
|
||||
BIN = grafx2.exe
|
||||
CFGBIN = gfxcfg.exe
|
||||
COPT = -W -Wall -O -g -ggdb `sdl-config --cflags`
|
||||
LOPT = `sdl-config --libs`
|
||||
CC = gcc
|
||||
OBJDIR = obj/win32
|
||||
else
|
||||
# Linux specific
|
||||
DELCOMMAND = rm -rf
|
||||
MKDIR = mkdir -p
|
||||
ifdef WIN32CROSS
|
||||
#cross compile a Win32 executable
|
||||
CC = i586-mingw32msvc-gcc
|
||||
BIN = grafx2.exe
|
||||
CFGBIN = gfxcfg.exe
|
||||
COPT = -Wall -O -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags`
|
||||
COPT = -W -Wall -O -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags`
|
||||
LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs`
|
||||
OBJDIR = obj/win32
|
||||
else
|
||||
BIN = grafx2
|
||||
CFGBIN = gfxcfg
|
||||
COPT = -Wall -c -g `sdl-config --cflags`
|
||||
LOPT = `sdl-config --libs`
|
||||
CC = gcc
|
||||
OBJDIR = obj/unix
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY : all debug release clean depend zip version force
|
||||
|
||||
OBJ = main.o init.o graph.o sdlscreen.o divers.o special.o boutons.o palette.o \
|
||||
aide.o operatio.o pages.o loadsave.o readline.o moteur.o files.o op_c.o \
|
||||
linux.o readini.o saveini.o shade.o clavier.o io.o version.o
|
||||
CFGOBJ = gfxcfg.o SFont.o clavier.o io.o
|
||||
|
||||
OBJDIR = obj/
|
||||
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o \
|
||||
$(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o \
|
||||
$(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o \
|
||||
$(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o\
|
||||
$(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/linux.o $(OBJDIR)/readini.o \
|
||||
$(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o \
|
||||
$(OBJDIR)/version.o
|
||||
CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o
|
||||
|
||||
all : $(BIN) $(CFGBIN)
|
||||
|
||||
@ -88,17 +95,20 @@ version : delversion version.c version.o
|
||||
delversion :
|
||||
$(DELCOMMAND) version.c
|
||||
|
||||
%.o :
|
||||
$(CC) $(COPT) -c $*.c -o $*.o
|
||||
$(OBJDIR)/%.o : $(OBJDIR)
|
||||
$(CC) $(COPT) -c $*.c -o $(OBJDIR)/$*.o
|
||||
|
||||
$(OBJDIR) :
|
||||
$(MKDIR) $(OBJDIR)
|
||||
|
||||
depend :
|
||||
$(CC) -MM $(OBJ:.o=.c) $(CFGOBJ:.o=.c) > Makefile.dep
|
||||
$(CC) -MM *.c | sed 's:^[^ ]:$(OBJDIR)/&:' > Makefile.dep
|
||||
|
||||
|
||||
clean :
|
||||
$(DELCOMMAND) *.o
|
||||
$(DELCOMMAND) $(BIN)
|
||||
$(DELCOMMAND) $(CFGBIN)
|
||||
$(DELCOMMAND) $(OBJ) $(CFGOBJ)
|
||||
$(DELCOMMAND) $(BIN) $(CFGBIN)
|
||||
|
||||
test :
|
||||
|
||||
include Makefile.dep
|
||||
-include Makefile.dep
|
||||
|
||||
90
Makefile.dep
90
Makefile.dep
@ -1,46 +1,44 @@
|
||||
main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \
|
||||
readini.h saveini.h linux.h io.h
|
||||
init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
|
||||
palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h
|
||||
graph.o: graph.c sdlscreen.h struct.h const.h graph.h divers.h moteur.h \
|
||||
boutons.h pages.h global.h loadsave.h erreurs.h
|
||||
sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
|
||||
divers.h erreurs.h graph.h
|
||||
divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \
|
||||
graph.h erreurs.h boutons.h moteur.h divers.h clavier.h
|
||||
special.o: special.c const.h struct.h global.h loadsave.h graph.h \
|
||||
moteur.h
|
||||
boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
|
||||
graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \
|
||||
erreurs.h readini.h saveini.h shade.h io.h aide.h sdlscreen.h
|
||||
palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \
|
||||
graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h
|
||||
aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
|
||||
moteur.h tables_aide.h aide.h sdlscreen.h
|
||||
operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \
|
||||
moteur.h graph.h operatio.h boutons.h pages.h erreurs.h
|
||||
pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \
|
||||
erreurs.h linux.h
|
||||
loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \
|
||||
divers.h pages.h op_c.h boutons.h erreurs.h linux.h io.h sdlscreen.h
|
||||
readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \
|
||||
divers.h erreurs.h linux.h sdlscreen.h
|
||||
moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
special.h boutons.h operatio.h shade.h erreurs.h linux.h sdlscreen.h
|
||||
files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
erreurs.h linux.h
|
||||
op_c.o: op_c.c op_c.h struct.h const.h erreurs.h
|
||||
linux.o: linux.c
|
||||
readini.o: readini.c const.h global.h struct.h loadsave.h graph.h
|
||||
saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \
|
||||
files.h erreurs.h graph.h
|
||||
shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \
|
||||
divers.h readline.h aide.h sdlscreen.h
|
||||
clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||
io.o: io.c struct.h const.h io.h
|
||||
version.o: version.c
|
||||
gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h
|
||||
SFont.o: SFont.c SFont.h
|
||||
clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||
io.o: io.c struct.h const.h io.h
|
||||
obj/win32/SFont.o: SFont.c SFont.h
|
||||
obj/win32/aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
|
||||
moteur.h tables_aide.h aide.h sdlscreen.h
|
||||
obj/win32/boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
|
||||
graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \
|
||||
erreurs.h readini.h saveini.h shade.h io.h aide.h sdlscreen.h
|
||||
obj/win32/clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||
obj/win32/divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \
|
||||
graph.h erreurs.h boutons.h moteur.h divers.h clavier.h
|
||||
obj/win32/files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
erreurs.h linux.h
|
||||
obj/win32/gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h
|
||||
obj/win32/graph.o: graph.c sdlscreen.h struct.h const.h graph.h divers.h moteur.h \
|
||||
boutons.h pages.h global.h loadsave.h erreurs.h
|
||||
obj/win32/init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
|
||||
palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h
|
||||
obj/win32/io.o: io.c struct.h const.h io.h
|
||||
obj/win32/linux.o: linux.c
|
||||
obj/win32/loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \
|
||||
divers.h pages.h op_c.h boutons.h erreurs.h linux.h io.h sdlscreen.h
|
||||
obj/win32/main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \
|
||||
readini.h saveini.h linux.h io.h
|
||||
obj/win32/moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||
special.h boutons.h operatio.h shade.h erreurs.h linux.h sdlscreen.h
|
||||
obj/win32/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h
|
||||
obj/win32/operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \
|
||||
moteur.h graph.h operatio.h boutons.h pages.h erreurs.h
|
||||
obj/win32/pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \
|
||||
erreurs.h linux.h
|
||||
obj/win32/palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \
|
||||
graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h
|
||||
obj/win32/readini.o: readini.c const.h global.h struct.h loadsave.h graph.h
|
||||
obj/win32/readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \
|
||||
divers.h erreurs.h linux.h sdlscreen.h
|
||||
obj/win32/saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \
|
||||
files.h erreurs.h graph.h
|
||||
obj/win32/sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
|
||||
divers.h erreurs.h graph.h
|
||||
obj/win32/shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h \
|
||||
divers.h readline.h aide.h sdlscreen.h
|
||||
obj/win32/special.o: special.c const.h struct.h global.h loadsave.h graph.h \
|
||||
moteur.h
|
||||
obj/win32/version.o: version.c
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user