FOLDERS = patches flatline FILES = Daodan.c Daodan_BSL.c Daodan_Character.c Daodan_Cheater.c Daodan_Config.c Daodan_Console.c Daodan_GL.c Daodan_Patch.c Daodan_Persistence.c Daodan_Utility.c Daodan_Win32.c Inifile_Reader.c _DLLInfo.rc patches/Patches.c flatline/Flatline.c flatline/Flatline_BSL.c flatline/Flatline_Client.c flatline/Flatline_Hooks.c flatline/Flatline_Net.c flatline/Flatline_Packet.c flatline/Flatline_PacketReader.c flatline/Flatline_PacketBuilder.c flatline/Flatline_Server.c flatline/Flatline_Win32.c flatline/Mariusnet.c flatline/Flatline_Events.c DEF = GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter $(addprefix -D,$(DEF)) LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll LOCALE = LC_MESSAGES=C #LIBS = -lwinmm -lopengl32 LIBS = -lgdi32 -lwsock32 OBJS = src/binkw32.def OUT = build/binkw32.dll ################################################### # # # Should not be required to change anything below # # # ################################################### UNAME := $(shell uname -s) ifeq ("Linux","$(UNAME)") GCC := i686-w64-mingw32-gcc WINDRES := i686-w64-mingw32-windres else GCC := gcc WINDRES := windres endif DESTFOLDERS = $(addprefix build/,$(FOLDERS)) SRC = $(addprefix src/,$(FILES)) DEST = $(patsubst src/%.rc,build/%.o,$(patsubst src/%.c,build/%.o,$(SRC))) ALL: $(DESTFOLDERS) $(DEST) $(OBJS) @echo "Linking" $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS) clean: rm $(DEST) rm -R $(DESTFOLDERS) rm $(OUT) $(DESTFOLDERS): mkdir -p $@ build/%.o: src/%.c @echo "Compiling $<" $(LOCALE) $(GCC) $(GCCFLAGS) -c -o $@ $< @echo build/%.o: src/%.rc @echo "Assembling resource $<" $(WINDRES) -i $< -o $@ @echo