Skip to content

Commit ec1d293

Browse files
committed
initial update for -j
I have added cjson to to the repo This is my first pass of adding -j, there is more work to do
1 parent 746891d commit ec1d293

File tree

4 files changed

+4017
-68
lines changed

4 files changed

+4017
-68
lines changed

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,22 @@ else
3636
endif
3737

3838
PROGRAM = uhubctl
39+
SOURCES = $(PROGRAM).c cJSON.c
40+
OBJECTS = $(SOURCES:.c=.o)
3941

40-
$(PROGRAM): $(PROGRAM).c
41-
$(CC) $(CPPFLAGS) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
42+
all: $(PROGRAM)
43+
44+
$(PROGRAM): $(OBJECTS)
45+
$(CC) $(CPPFLAGS) $(CFLAGS) $(OBJECTS) -o $@ $(LDFLAGS)
46+
47+
%.o: %.c
48+
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
4249

4350
install:
4451
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
4552
$(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(sbindir)
4653

4754
clean:
48-
$(RM) $(PROGRAM).o $(PROGRAM).dSYM $(PROGRAM)
55+
$(RM) $(OBJECTS) $(PROGRAM).dSYM $(PROGRAM)
56+
57+
.PHONY: all install clean

0 commit comments

Comments
 (0)