Skip to content

Commit

Permalink
streamline makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Jul 20, 2024
1 parent a861fb4 commit 98c811d
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ChucK VERSIONS log
- (fixed) local non-control structure local scope Objects now correctly cleaned
up at the end of local scope
- (updated) more and clearer error messages when initializing real-time audio
- (developer) clean up makefile `clean` target
- (developer) streamline makefile targets 'test' 'doc' 'clean'


1.5.2.4 (April 2024)
Expand Down
1 change: 1 addition & 0 deletions src/host-examples/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ $(HOST_EXES): chuck-core $(COBJS_HOST) $(CXXOBJS_HOST) $(CXXOBJS_HOST_EXE)

# clean generated files
clean:
@echo "removing compiled host-examples files..."
@rm -rf $(HOST_EXES) *.o *.d */*.{o,d} */*/*.{o,d} \
$(OBJS) $(patsubst %.o,%.d,$(OBJS))*~ $(CHUCK_CORE_DIR)/chuck.output \
$(CHUCK_CORE_DIR)/chuck.tab.h $(CHUCK_CORE_DIR)/chuck.tab.c $(CHUCK_CORE_DIR)/chuck.yy.c \
Expand Down
24 changes: 15 additions & 9 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,15 @@ $(CXXOBJS_HOST): %.o: %.cpp


############################## RUN UNIT TEST ##################################
.PHONY: test
test:
(cd test && ./test.py ../chuck .)
@make -C test


####################### GENERATE API DOCUMENTATION ############################
.PHONY: doc ckdoc
doc ckdoc:
@make -C scripts/ckdoc


############################### DISTRIBUTION ##################################
Expand Down Expand Up @@ -312,19 +319,18 @@ endif


############################## CLEAN UP #######################################
clean:
.PHONY: clean-src
clean-src:
@echo "removing compiled output..."
@rm -rf $(wildcard chuck chuck.exe) *.o *.d */*.{o,d} */*/*.{o,d} \
$(OBJS) $(patsubst %.o,%.d,$(OBJS))*~ $(CK_CORE_DIR)/chuck.output \
$(CK_CORE_DIR)/chuck.tab.h $(CK_CORE_DIR)/chuck.tab.c $(CK_CORE_DIR)/chuck.yy.c \
$(DIST_ROOT)/$(DIST_DIR) $(DIST_ROOT)/$(DIST_DIR){,.tgz,.zip} \
host-web/webchuck/js/webchuck.js host-web/webchuck/js/webchuck.wasm \
Release Debug
@echo "removing generated ckdoc files..."
@rm -f scripts/ckdoc/*.css scripts/ckdoc/*.html
@echo "removing generated test files..."
@rm -f test/03-Modules/01-file-io.bin test/03-Modules/08-write-read-op.txt \
test/03-Modules/09-write-output.txt test/03-Modules/file.bin \
@echo "removing compiled host-examples files..."
@make -C host-examples clean

.PHONY: clean
clean: clean-src
@make -C scripts/ckdoc clean
@make -C host-examples clean
@make -C test clean
3 changes: 3 additions & 0 deletions src/scripts/ckdoc/gen-all.ck
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@ doc.addGroup(
// generate
doc.outputToDir( ".", "ChucK Class Library Reference" );

// print
<<< "API reference files generated in 'src/scripts/ckdoc/'", "" >>>;

// TODO: print what was generated (or add option to)
// TODO: print what types are in the type system but wasn't documented
27 changes: 27 additions & 0 deletions src/scripts/ckdoc/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###############################################################################
# name: makefile
# desc: CK Doc / API Reference generation for ChucK programming language
#
# ChucK website: https://chuck.stanford.edu/
# source repository: https://github.com/ccrma/chuck/
#
# currently live API Reference:
# API Reference: https://chuck.stanford.edu/doc/reference/
###############################################################################

all: ckdoc

############################## RUN UNIT TEST ##################################
ckdoc:
ifneq (,$(wildcard ../../chuck ../../chuck.exe))
@echo "generating ChucK API reference using ckdoc..."
../../chuck gen-all.ck
else
@echo "no chuck executable found in 'src/'...(hint: make in 'src/')"
endif


############################## CLEAN UP #######################################
clean:
@echo "removing generated API reference files..."
@rm -f *.css *.html *.json
25 changes: 25 additions & 0 deletions src/test/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###############################################################################
# name: makefile
# desc: unit testing for ChucK programming language
#
# ChucK website: https://chuck.stanford.edu/
# source repository: https://github.com/ccrma/chuck/
###############################################################################

all: test


############################## RUN UNIT TEST ##################################
test:
ifneq (,$(wildcard ../chuck ../chuck.exe))
./test.py ../chuck .
else
@echo "no chuck executable found in 'src/'...(hint: make in 'src/')"
endif


############################## CLEAN UP #######################################
clean:
@echo "removing generated test files..."
@rm -f 03-Modules/01-file-io.bin 03-Modules/08-write-read-op.txt \
03-Modules/09-write-output.txt 03-Modules/file.bin \

0 comments on commit 98c811d

Please sign in to comment.