PROS Directories?

Good morning PROS enthusiasts,

I’ve been struggling with something very strange recently and wanted to reach out for help.

Here’s the thing:

I wanted to organize my PROS files directories by putting individual “.c” and “.h” files into folders.

Sort of like this -

  • Functions (Folder)
    • arm.c
    • drive.c
    • claw.c
  • Functions
    • arm.h
    • drive.h
    • claw.h

As you can see, the “.c” files are inside of the source folder while also being apart of the Functions folder.

This should work and would also keep the program very organized, but the compiler goes haywire and doesn’t even touch the files in folders.

If there is a work around to this issue, I would love to hear it!


Subfolders need to have their own Makefile, but it’s pretty easy. For example, look at my StarStruck Code on Github. It has a subfolder called utility, with a Makefile

Thank you very much! I will look into it.

Marking as resolved.

Contact the PROS team for more information. They are active on Discord, and generally respond pretty quick here too

What have I done? @MayorMonty

make[1]: Nothing to be done for `all’.
make[1]: *** No targets specified and no makefile found. Stop

Could you give me the full stdout/stderr, as well as the command you ran?

No idea what those things mean. stdout and stderr?

My source file has the following folders:

  • bodilyFuncs
        • arm.c, drive.c, claw.c
  • lcd
        • nothing
  • userFiles
        • recording.c, auton.c, opctrl.c
  • prosFiles
        • created_opctrl.c, created_auton.c, created created_init.c

My makefile in my root folder was:

# Universal C Makefile for MCU targets

# Path to project root (for top-level, so the project is in ./; first-level, ../; etc.)
# Binary output directory
# Subdirectories to include in the build
SUBDIRS=src src/bodilyFuncs src/prosFiles src/userFiles src/lcd

# Nothing below here needs to be modified by typical users

# Include common aspects of this project
-include $(ROOT)/

ASMSRC:=$(wildcard *.$(ASMEXT))
ASMOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(ASMSRC:.$(ASMEXT)=.o))
HEADERS:=$(wildcard *.$(HEXT))
CSRC=$(wildcard *.$(CEXT))
COBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CSRC:.$(CEXT)=.o))
CPPSRC:=$(wildcard *.$(CPPEXT))
CPPOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CPPSRC:.$(CPPEXT)=.o))

.PHONY: all clean upload _force_look

# By default, compile program
all: $(BINDIR) $(OUT)

# Remove all intermediate object files (remove the binary directory)
	-rm -f $(OUT)
	-rm -rf $(BINDIR)

# Uploads program to device
upload: all

# Phony force-look target

# Looks in subdirectories for things to make
$(SUBDIRS): %: _force_look
	@$(MAKE) --no-print-directory -C $@

# Ensure binary directory exists
	-@mkdir -p $(BINDIR)

# Compile program
	@echo LN $(BINDIR)/*.o $(LIBRARIES) to $@
	@$(CC) $(LDFLAGS) $(BINDIR)/*.o $(LIBRARIES) -o $@

# Assembly source file management
	@echo AS $<
	@$(AS) $(AFLAGS) -o $@ $<

# Object management
$(COBJ): $(BINDIR)/%.o: %.$(CEXT) $(HEADERS)
	@echo CC $(INCLUDE) $<
	$(CC) $(INCLUDE) $(CFLAGS) -o $@ $<

	@echo CPC $(INCLUDE) $<
	@$(CPPCC) $(INCLUDE) $(CPPFLAGS) -o $@ $<

The other Makefile is default, located in the src folder. No modifications made to that.

I ran the regular make -ji command to make the file.

Hi Aditya, I’ll reply here and not through your email.

Copy the Makefile in src into your subdirectory bodilyFuncs (or whatever). Modify line 4 to go from:




then, in the Makefile at the root directory, modify line 8 from:



SUBDIRS=src src/bodilyFuncs

And do the same thing for all your other directories.

Excuse me, STDOUT/STDERR means the exact output you get when you type the command

No worries. I’m just a dunce :stuck_out_tongue:

Thank you for the run-down. I’ll make those changes and get back to you.

Hi, recently I meet the same problem with Makefile.
I not only want to solve this problem, but learn something about Makefile,
May I ask for some way to understand Makefile better?

Does this error only happens with c files? or will cpp files in a sub folder also cause the error?

Please do not revive dead threads. You already have your own thread about your issue and another thread about learning how to work with makefiles.

Also, a simple Google search reveals several websites documenting makefiles and how to work with them.

For current and future readers, the Makefiles in the latest versions of PROS for Cortex and PROS for V5 support recursive search for source files and no modification needs to be made to make PROS compile subdirectories of the src folder (or subdirectories of subdirectories, etc.).