User forums > Help

Moving from makefile to C::B project

(1/2) > >>

visir:
I'd like to redo one makefile as a codeblocks project, but I'm not sure if that's possible. The problems are:

1)  options and ifeq

DP_CDDA?=enabled
ifeq ($(DP_CDDA), enabled)
   OBJ_CD=cd_shared.o cd_win.o
else
   OBJ_CD=cd_shared.o cd_null.o
endif

2) different compile flags for some files

dpsoftrast.o: dpsoftrast.c
   $(DO_CC) $(CFLAGS_SSE2)

sodev:
1) Depending on how many different configurations you have this could be done with (virtual) targets.

2) You could define a custom build step for a file that specifies different compiler options, but it might be quite cumbersome to replicate all common ones. It might be better to put all files with the same compiler options in one project that produces a static lib and specify the options on project level.

visir:
Can't use virtual targets, too many different combinations of options.

Ok, I changed my mind. How to create a codeblocks project that only uses makefile? Tried to File -> New -> Project -> Empty project, it said I must have at least one build target (Debug or Release).

Little feature request, I hope codeblocks would react in some way to opening an empty .cbp file. Like, allow viewing files in this directory, and save a correct project file on exit.

BlueHazzard:
Create a empty project (always hit yes and enter a name) go with the targets for the moment...

Then Project->Properties->This is a custom Makefile and you are fine

just out of curiosity: what kind of project is this, that you need different compiler flags for different files, or what flags are those?

greetings

visir:
Read stripped down makefile here, https://pastebin.com/DBhd6xHs  , or full version on svn (google darkplaces)

Interesting part starts from prvm_cmds.o: prvm_cmds.c

I'm currently trying to understand it, and throw everything unnecessary out.

Navigation

[0] Message Index

[#] Next page

Go to full version