KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am currently failing to write a good makefile and don't know the reason why.. -.- This is my main.c: #include <windows.h> #include <stdio.h> int main(int argc, char *argv[]) { printf("MEEEEEP"); return (0); } This is my makefile: # make SYSTEM= OS= ENVIRONMENT= # Binaries to use ifeq ($(ENVIRONMENT),MINGW) CXX = i686-pc-mingw32-g++ else CXX = g++ endif REMOVE = rm -vf RC = windres EXE = .exe ############################################################# # Info ifeq ($(CXX),g++) INFO_CXX = g++ -dumpversion; g++ -dumpmachine endif ############################################################# # Flags DEBUG = -DDEBUG -g OPTIMIZATION = -O2 #-Winline -finline-functions CFLAGS = -Wall -Wextra -W -static $(DEBUG) $(OPTIMIZATION) -D$(SYSTEM) -D$(OS) -D$(ENVIRONMENT) $(PRGFLAGS) ifeq ($(SYSTEM),I686) CFLAGS += -m32 ifeq ($(OS),WIN32) CFLAGS += -D_WIN32 endif ifeq ($(ENVIRONMENT),MINGW) CFLAGS += -fexceptions endif endif LFLAGS = ############################################################# # Files CFILES = main.c OBJS = ${CFILES:.c=.o} ############################################################# # Include INCLUDES = -I. ############################################################# # Library LIBRARIES = ############################################################# # Targets .PHONY: all all: @echo == Standard build: make SYSTEM=I686 OS=WIN32 ENVIRONMENT=MINGW @echo @echo make SYSTEM=I686 OS=WIN32 ENVIRONMENT=MINGW gyro ############################################################# # Implicit rules and filename extensions... .SUFFIXES: .h .o .c .c.o: %.h @echo Compiling $< for $(SYSTEM) $(OS) $(ENVIRONMENT) ... @echo MEEP $(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ @echo MEEP2 ############################################################# # Target rules gyro: $
Tags (comma-separated)
Save Edits
Cancel