Makefiles: Force building 32 or 64 bit by setting ARCH=32 or 64
[sdk] / compiler / bootstrap / ecc / Makefile
index 9fe70d6..0cf1c1d 100644 (file)
@@ -17,6 +17,7 @@ ifndef DEBIAN_PACKAGE
 CFLAGS =
 LDFLAGS =
 endif
+PRJ_CFLAGS =
 CECFLAGS =
 OFLAGS =
 LIBS =
@@ -58,9 +59,8 @@ LIBS += \
        $(call _L,ecBootstrap)
 endif
 
-CFLAGS += \
-        $(if $(DEBIAN_PACKAGE),$(CPPFLAGS),) $(if $(DEBUG), -D_DEBUG,) \
-        $(if $(DEBUG), -g, -O2 -ffast-math) $(FORCE_32_BIT) $(FPIC) -w \
+PRJ_CFLAGS += \
+        $(if $(DEBUG), -g, -O2 -ffast-math) $(FPIC) -w \
                         -DECERE_STATIC
 
 
@@ -85,9 +85,9 @@ endif
 CECFLAGS += -cpp $(_CPP)
 
 ifndef STATIC_LIBRARY_TARGET
-OFLAGS += $(FORCE_32_BIT) \
-        -L../ecere/obj/bootstrap.$(PLATFORM) \
-        -L../libec/obj/bootstrap.$(PLATFORM)
+OFLAGS += \
+        -L../ecere/obj/bootstrap.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX) \
+        -L../libec/obj/bootstrap.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)
 endif
 
 # TARGETS
@@ -106,17 +106,17 @@ endif
 # OBJECT RULES
 
 $(OBJ)ecc.o: bootstrap/ecc.c
-       $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ecc.c -o $(OBJ)ecc.o
+       $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/ecc.c -o $(OBJ)ecc.o
 
 $(OBJ)ecc.main.o: bootstrap/ecc.main.c
-       $(CC) $(CFLAGS) $(FVISIBILITY) -c bootstrap/ecc.main.c -o $(OBJ)ecc.main.o
+       $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/ecc.main.c -o $(OBJ)ecc.main.o
 
 clean: objdir
        $(call rmq,$(TARGET))
        $(call rmq,$(OBJECTS))
 
-realclean: clean
+realclean: objdir
        $(call rmrq,$(OBJ))
 
-distclean:
+distclean: objdir
        $(call rmrq,obj/)